1

I have a problem with my datagridview and datatable jquery paginator.

So, I bind my grid with some data and the paginator only show one number at a time. Sample:

Total number of records: 50

First 2 disabled, Last 2 enabled << < 1 > >>

I press next button and... all buttons enabled << < 2 > >>

Images

First load of the datagrid

When I press next button

I really don't know why this happens.

Here is the code to build the datatable at client side.

var previous = "&lt;"; var next = ">"; var first = "»"; var last = "«";
$(document).ready(function () {
    $("#tableID").dataTable({
        "sPaginationType": "full_numbers",
        "oLanguage": {
            "oPaginate": {
                "sPrevious": previous,
                "sNext": next,
                "sLast": first,
                "sFirst": last
            },
            "sEmptyTable": "No results",
            "sZeroRecords": "No results"
        },
        "sCookiePrefix": "MyCoooierefdgfix_tableID",
        "bStateSave": false,
        "bLengthChange": false,
        "bAutoWidth": false,
        "bInfo": false,
        "bSort": false,
        "bFilter": false,
        "iDisplayLength": parseInt(pageSize),
        "bDestroy": true
    });
});
9
  • Can you provide an example on jsFiddle.net? Nov 7, 2011 at 11:28
  • Actually I can't because the application structure is too complex. Too much CSS, and javascript code :/ Sorry
    – rpf
    Nov 7, 2011 at 11:34
  • It's because it's not clear what's happening, can you provide some images? Nov 7, 2011 at 11:36
  • Is the data in the table being loaded via Ajax? I've had this problem before when using ajax and not passing the iTotalRecords parameter. Nov 7, 2011 at 11:36
  • @NicolaPeluchetti: images included
    – rpf
    Nov 7, 2011 at 11:42

1 Answer 1

0

I've set-up a fiddle for you and everything works correctly. You can look at it here. Maybe you have an error in your html and so the plugin cannot calculate the correct number of rows, that's the only thing i can think of.

EDIT - i can replicate your problem by adding this line of CSS as you can see here. Are you sure it's not happening something like that?

span span.paginate_button{
  display:none;  
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.