Use ASP pagination with Datatables

Use ASP pagination with Datatables

GreatNewsGreatNews Posts: 5Questions: 2Answers: 0
edited February 2019 in Free community support

Hi, I'm trying to use my own ASP pagination with Datatables JQuery (1.10.18).

The problem is that I cannot run the datatables script without removing the pagination that ASP generates when binding a GridView.

I'd like to know if there's a way to run the script without doing it.

At this moment, I'm running
$('#id_table tbody tr.tableClass-paginado').remove();

If I don't run this I get this error:
Cannot set property '_DT_CellIndex' of undefined

It's worth mentioning that I'm conscious about the problem with the table's header but I, already, solved this issue. It all works fine.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @GreatNews ,

    It's because DataTables is expecting one less column - which you fix by removing it before the initialisation. The other option is to add it into the initialisation configuration with columns,

    Cheers,

    Colin

  • GreatNewsGreatNews Posts: 5Questions: 2Answers: 0

    But the problem is when I do not remove the asp pagination.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @GreatNews ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.