bServerSide on generator code, and multiple pagination interfering with editor

bServerSide on generator code, and multiple pagination interfering with editor

javismilesjavismiles Posts: 205Questions: 38Answers: 3
edited March 2014 in Editor
Good day :)
i am testing the editor with the trial because i am interested in purchasing it ,i think its wonderful,
i have used the automatic generator to generate the code, this makes things very fast, and then i just tweak parameters,
i have managed to make it work now all perfect, everything works to perfection, but i have two issues still

1) My tables will grow very large, so i need to use the
"bServerSide": true,
parameter, problem is the code generated by the generator cannot cope with this parameter,
when using it, i get the "Showing 1 to NaN of NaN entries (filtered from NaN total entries)"
message and all the rows are loaded at once,
obviously something is missing in the php backend part,
i thought the code generated by the generator would already be ready for the bServerSide parameter but seems is not,
what extra code do i need to make bServerSide work?

2) The other thing is that i wanted to have pagination both bottom and top, this works great using
"sDom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>',
when initiating dataTables,
however when i do it, i cannot select anymore rows to edit them, i click on a row and it doesnt get selected,
if i take out that line then i can select it again

thank you very much for your help
best wishes

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    > 1. i thought the code generated by the generator would already be ready for the bServerSide parameter but seems is not

    It should be! It should be the case that all you need to do is enable the bServerSide flag in the Javascript and the Editor PHP libraries will automatically detect the extra parameters. The only thing, off the top of my head, that would cause the error you are seeing is using DataTables 1.10 with Editor 1.2 PHP libraries, without enabling legacy server-side processing. is that the case? ( http://next.datatables.net/manual/server-side#Legacy ).

    Failing that, I'd need to know what the server is responding with in the JSON data I think, or ideally have a link to the page.

    > 2. however when i do it, i cannot select anymore rows to edit them, i click on a row and it doesnt get selected,

    Add the `T` option into your sDom. Each character in sDom is a feature (unless enclosed by quotes). `T` is the TableTools feature, which is used for row selection.

    Allan
  • javismilesjavismiles Posts: 205Questions: 38Answers: 3
    Hi Allan
    thank you very much for your kind help,
    regarding issue 2, i solved that no probs
    regarding issue 1, i generated this code with the automatic generator on editor's website just 2 days ago so i assume everything should be updated, i mean its 2 days ago, i assume the datatables etc that came with code is latest versions?
    so basically im using datatables and editor's that came with it,
    i just took a look, this is what came with it

    * File: jquery.dataTables.min.js
    * Version: 1.9.4
    and
    * File: dataTables.editor.min.js
    * Version: 1.2.4

    this came automatically in the downloaded file

    regarding JSON data returned, the code is returning the entire table in the JSON,
    i could show you the page but its my live website so cant make it public here the link,
    or maybe i can setup a separate test separately,

    thank you for your help again
    best wishes
  • javismilesjavismiles Posts: 205Questions: 38Answers: 3
    I just checked again, this is what happens

    1) First all the rows of table are returned all at once, so even if limit set to 10, the 500 rows are returned and shown
    2) Second, we read: Showing 1 to NaN of NaN entries (filtered from NaN total entries)
    3) As for the JSON, i took a look with Google Chrome Developer Network Debugger, there is no error, simply the JSON contains all the rows of the table! :)

    what can be the problem? Code generated TWO days ago with AutoGenerator on website, which contains
    * File: jquery.dataTables.min.js
    * Version: 1.9.4
    and
    * File: dataTables.editor.min.js
    * Version: 1.2.4

    best :)
This discussion has been closed.