serverside delete now page all data but still get original start index

serverside delete now page all data but still get original start index

jeffmikejeffmike Posts: 1Questions: 1Answers: 0

I'm using jquery.datatable server side table
case is this:
When I have data count like 13, pageLength given 10, go to second page, delete 3 data, then table show the first page's 10 data, all fine but the startIndex and pageIndex in the bottom of the table still same as second page

How do I let the startIndex and the pageIndex turn to first page's state?

When I delete data, I will delete data from my database, then use
var table = $('#id').DataTable(); table.ajax.reload(null, false);
to reload the table

using datatable's ajax to get data like this
`
"ajax": function (page, callback, settings) {
var param = {};
param.draw = page.draw;
param.length = page.length;
param.start = page.start;
param.pageIndex = (page.start / page.length) + 1;
param.orderColumn = page.columns[page.order[0].column].data;
param.orderDir = page.order[0].dir;

        $.ajax({
            type: "post",
            url: 'xxx.aspx/GetData',
            contentType: "application/json;charset=utf-8",
            cache: false,
            data: JSON.stringify({ inputdata: JSON.stringify(param) }), 
            dataType: "json",
            success: function (resultData) {
                //bind data
            }
        });

})
`

Sign In or Register to comment.