Ajax enabled tables not loading on pageload after upgrade to 2.28.8
nlcoredump opened this issue · 11 comments
Hi
After i upgraded to 2.28.8 my ajax enabled tables are not loading on pageload. You have to use the pager buttons or page length change to trigger a load of the table. When i switch back to 2.28.7 everything is working fine again. Do i need to trigger anything to start the table load on page load? i am using the processAjaxOnInit : true
Thx
I'm having this exact same issue. I've managed to trace it so far to the moveToPage
method aborting early on this line because the value of filter_initialized
is undefined:
if (p.ajax && ts.hasWidget(table, 'filter') && !c.widgetOptions.filter_initialized) {
return;
}
Has something changed about the filter widget, in terms of how we need to initialize it?
Here's my console output with debugging enabled:
21:21:34.809 Initializing tablesorter v2.28.8
21:21:34.826 Built headers: (8 ms)
21:21:34.827 Object { length: 3, 3 more… }
21:21:34.838 Detecting parsers for each column
21:21:34.838 No parsers detected!
21:21:34.839 Completed detecting parsers (1 ms)
21:21:34.840 validate options time: (0 ms)
21:21:34.841 Building cache for 0 rows (showing 0 rows in log) and 3 columns (0 ms)
21:21:34.841 console.table():
21:21:34.847 Start initializing widgets
21:21:34.847 Initializing saveSort widget
21:21:34.848 Storage widget using localStorage
21:21:34.849 saveSort: Last sort loaded: "0,1" (1 ms)
21:21:34.850 Completed initializing saveSort widget (3 ms)
21:21:34.850 Initializing sort2Hash widget
21:21:34.852 Completed initializing sort2Hash widget (2 ms)
21:21:34.855 Applying sort 0,1 (0 ms)
21:21:34.857 Rebuilt table (2 ms)
21:21:34.858 Start applying widgets
21:21:34.858 Updating saveSort widget
21:21:34.859 Completed applying saveSort widget (1 ms)
21:21:34.859 Updating filter widget
21:21:34.865 Storage widget using localStorage
21:21:34.867 Completed applying filter widget (8 ms)
21:21:34.868 Start applying widgets
21:21:34.868 Updating saveSort widget
21:21:34.869 Completed applying saveSort widget (1 ms)
21:21:34.869 Updating filter widget
21:21:34.870 Completed applying filter widget (1 ms)
21:21:34.871 Overall initialization time: (61 ms)
21:21:34.872 Storage widget using localStorage
21:21:34.876 Pager: Initializing
21:21:34.877 Storage widget using localStorage
21:21:34.886 Calling moveToPage
21:21:34.891 Detecting parsers for each column
21:21:34.892 No parsers detected!
21:21:34.892 Completed detecting parsers (1 ms)
21:21:34.893 Building cache for 0 rows (showing 0 rows in log) and 3 columns (0 ms)
21:21:34.894 console.table():
21:21:34.895 Start applying widgets
21:21:34.896 Updating saveSort widget
21:21:34.896 Storage widget using localStorage
21:21:34.897 saveSort widget: Saving last sort: 0,1 (1 ms)
21:21:34.899 Completed applying saveSort widget (3 ms)
21:21:34.900 Updating filter widget
21:21:34.901 Completed applying filter widget (1 ms)
21:21:34.902 Calling moveToPage
21:21:34.903 Pager: Enabled
21:21:35.038 Calling moveToPage
21:21:35.038 Completed applying 3 widgets (143 ms)
Hi @nlcoredump & @alexweissman!
Odd... is this only happening with the pager addon or widget?
For me, the addon appears to be working, but the widget seems to misbehave in the jsFiddle, but not on the main documentation page (even when I disable the initial sort).
Has something changed about the filter widget, in terms of how we need to initialize it?
No, the filter_initialized
doesn't get set until after tablesorter has completed initialization and then it is done inside of a setTimeout
set to 100 milliseconds to allow the filter_formatter
functions to complete rendering.
I believe I'm using the widget. I initialize it as:
ts.tablesorterPager(pagerOptions);
I haven't tried the plugin.
Actually, that is the plugin.
Hi @Mottie,
i try to upgrade to latest version i got the same problem. I figured out, that if use the Filter widget from Tag v.28.7 with the Pager widget v.28.8 it works fine.
the difference of the filterwidget this the new function equalFilters.
Maybe this information can help you to solve the problem.
I just updated the pager widget in v2.28.11... please check that it resolves this issue.
@alexweissman I didn't touch the pager addon this time, as I was not able to reproduce the problem in the addon.
Hi @Mottie
the Pager widget works now.
pageraddon: if you add the filter widget in your fiddle http://jsfiddle.net/9nfu2ja5/3/ the same problem occurs
Hi @CiTRO33!
Oh, you're right... I'm not sure how I missed that before. I'll add a fix to the master branch. I haven't decided when the next release will be available.