Pagination not enabled

Pagination not enabled

SyGENSyGEN Posts: 4Questions: 0Answers: 0
edited March 2010 in General
Hi,

First of all, I'd like to thank the author of this magnific tool !
Nevertheless, I have a small prob with pagination icons not enabling.

I have set up as in demo for server-side the tool like this :
[code]
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "dsp_search.cfm",
"bPaginate": true
} );
} );
[/code]

the returned JSON gives me this
[code]
{"sEcho":10,"aaData":[[1000,"ACQUISITION DE COMPETENCES","AN","ACT"],[1000,"Action de commercialisation de produits du terroir","AN","ACT"],[1000,"APPUI TECHNIQUE","AN","ACT"],[1000,"Appui Technique","AN","ACT"],[1000,"APPUI TECHNIQUE","AN","ACT"],[1000,"Appui technique GAL","AN","ACT"],[1000,"Arch

Replies

  • SyGENSyGEN Posts: 4Questions: 0Answers: 0
    edited March 2010
    FYI, here is the working (but those icons) coldfusion code i wrote to generate my datas and that could help CF developers to integrate your tool softly. (I saw lot's of complicated CF stuff in this forum as it can be done more easily when using CF >= 8 versions)

    [code]
















    SELECT
    #columnList#
    FROM
    DOCUMENTS

    WHERE
    #searchField# LIKE


    LIMIT
    ,




    SELECT
    count(docid) rownbr
    FROM
    DOCUMENTS


    <!--- Generate JSON from Query --->














    <!--- Since SerializeJSON capitalize the content which is case-sensitive let's reset it the correct way --->







    #tmpSOut#


    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    iTotalDisplayRecords is the total number of records in the data set after filtering - not just aData.length (which DataTables can do itself!). So if you have no filtering iTotalDisplayRecords should be exactly the same as iTotalRecords: http://www.datatables.net/usage/server-side

    Allan
  • SyGENSyGEN Posts: 4Questions: 0Answers: 0
    Thanks a lot, I just skipped this little detail. Working perfectly now.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Good stuff :-)

    I've added this as an FAQ now: "Pagination is not enabled, or the information text shows the wrong data set count" - http://datatables.net/faqs

    Allan
  • SyGENSyGEN Posts: 4Questions: 0Answers: 0
    Cool ;)

    I've edited the code above so everyone can use it as is (of course with dsn & table changes).
    Now let's start trying the pipelining in CF. If I succeed, i'll post it here too.
This discussion has been closed.