page size control and filter disappear after postback
page size control and filter disappear after postback
NoBullMan
Posts: 61Questions: 17Answers: 2
Initially both page size control and filtering show up on top of the table. I have a link in each row of data table to cause a postback. On postback table and data is there but page size selection and filtering are gone.
$(document).ready(function () {
var $j = jQuery.noConflict();
var adminUsersDT = $j("#fcTable").DataTable({ dom: 'lfrtip' });
})
This discussion has been closed.
Answers
Any gurus out there; anyone?
Maybe you can post a link or a test case showing the issue. In order to help we would need to see what you are doing. The code you posted is basic Datatables init code and doesn't provide the detail of what you are trying to do.
Kevin
Thanks for the response.
I am displaying data inside a boostrap table wrapped by jQuery datatable. The rows are generated using asp.net repeater control.
Initially, i see search and page size selection. I click on a button that causes postabck; data in the table is updated but search and page size control disappear.
in .aspx file:
in aspx.cs; Page_Load():
I realized it is not just the search and page size selection that disappear; the entire jquery datatabe goes away; I lose all the jQuery Datatable functionality (sorting, ...). Not sure how to reconstruct the datatable on postback.
Maybe you are getting a Javascript error?
Have you checked the browser's console for errors?
Kevin
I noticed the problem was caused by table being inside an update panel and jQuery script outside of it. Partial postback did not force the script to run again. If I remove the update panel it works fine. Any idea on how to have the update panel and jQuery Datatable both? Moving the script inside update panel did not help either.
I see alot of people having issues with jQuery datatable and update panels. However, none of the issues I found on the forum has a response or a fix; most just say this idscussion is closed!
for someone running into this issue and not getting any response!
Keep your data table inside update panel and add the following javascript code: