Custom paging condition - Can we ?

Custom paging condition - Can we ?

duongdnduongdn Posts: 3Questions: 0Answers: 0
edited June 2013 in General
Hello all,
Can you help me solve my problem ?
The following is my table

Col1|
Col1| Col2| Col3 | Col4
Col1| Col2| Col3 | Col4
Col1| Col2| Col3 | Col4
Col1|
Col1| Col2| Col3 | Col4
Col1| Col2| Col3 | Col4
Col1| Col2| Col3 | Col4
Col1| Col2| Col3 | Col4
Col1|
Col1| Col2| Col3 | Col4
....

I need to apply paging only for the column with colspan=4 (Can we see them like 'Category' rows).

Do you know any feature/plugin to make it ?

Thanks so much

DuongDN

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Currently no. colspan can't be used in the tbody of a DataTables table. Sorry.

    You can hack around it like this example: http://datatables.net/release-datatables/examples/advanced_init/row_grouping.html - but that's currently as good as it gets.

    Allan
  • duongdnduongdn Posts: 3Questions: 0Answers: 0
    Hello Allan,
    Thank for your response.
    I think I make a bad explanation and you misunderstand
    Actually, I created this table with colspan in the tbody with following callback

    "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
    var iCol = $(nRow).children('td').length;
    if(!aData[1] &&!aData[2] && !aData[3] && !aData[4]){
    $(nRow).children('td:gt(0)').css('display', 'none');
    $(nRow).children('td:first').attr('colspan', iCol);
    }
    }

    Now I need to make paging on my table based on the rows with cospan=4 (I call them 'Category' rows). I'm looking for the solution for this case. Can you give me a advise ?

    DuongDN
  • ArtjomArtjom Posts: 48Questions: 0Answers: 0
    Is colspan support in tbody currently on the map for DataTable :)?

    Thanks
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Oh I see - hmm. No - I don't think there is a way of doing that with DataTables at the moment. I suppose it might be possible with the API and changing the page length on each page event, but its not something I've tried before. Interesting though - I might try that sometime.

    > Is colspan support in tbody currently on the map for DataTable :)?

    Sort of. For grouping content, then yes, in v2. But before that v1.10, 1.11 and 1.12 are planned. So it's a while off!

    Allan
  • duongdnduongdn Posts: 3Questions: 0Answers: 0
    Hi all,
    I solved my problem with server side paging technique.

    Thank for your ideas.

    DuongDN
This discussion has been closed.