1
votes

I have a asp.net gridview and used a jquery dataTable. The search feature works fine but the problem is after I searched and click the edit button, the table becomes empty. I used stateSave : true but it's not working. Can anyone help me?

thanks.

enter image description here

//jQuery code for DataTables

           $(document).ready(function () {
        $('#myTable').DataTable({
            stateSave: true,
            stateDuration: -1

    });
    $('#myTable').addClass("table table-hover");
});
2
Show your code. otherwise how are we suppose to know why?Alex Jolig
Hi Alex, please see the code. thanksFrancis Saul
This is styling code not insert, edit or delete code on databaseAlex Jolig
Your browser supports HTML5 ?mck
@mck: yes, i'm using google chromeFrancis Saul

2 Answers

1
votes

// use below code along with your ready function

 function pageLoad(sender, args) {
            if (args.get_isPartialLoad()) {

 $('#myTable').DataTable({
            stateSave: true,
            stateDuration: -1
    });
    $('#myTable').addClass("table table-hover");
            }
        }
0
votes

If your searched text remains in the text box then it will automatically search's in the table again after loading. To avoid this you have to FALSE the saved State.

Regards, Vijay.