Problems with ServerSide: true
Problems with ServerSide: true
Hi,
I got some issues with ServerSide processing. As soon as serverSide Processing is enabled there are 2 Problems:
Try: add something(add Button), then edit a few fileds (inline), then Try to add another -> now Dialog is coming anymore, also delete doesn't work anymore. (sometimes it works for a while)
-> there is a error in the Firefox consol log: TypeError: idx is undefined
On Line: 4873 in datatables.editor.js:
```var col = dt.settings()[0].aoColumns[ idx.column ];I used the code "Tab between colums", from you example. This codes is not working on if i set ServerSide: true
I've no problems and all works perfect as long as i set ServerSide: false, but as soon as i change ServerSide to true the above mentioned problems occur.
To test it:
with the issues (only difference ServerSide: true):
http://sils.convercom.ch/datatablesIssue/
without any issues (only difference ServerSide: false):
http://sils.convercom.ch/datatablesIssue/
http://sils.convercom.ch/datatablesClient/
Is there migth a problem with ServerSide: true ? or are im doing something wrong/forgot some thing ?
Thanks in advise,
Marcel
Replies
the link without issues is: http://sils.convercom.ch/datatablesClient/ i double posted the one with issues
Hi!
1) Could you show me the PHP you are using here? It looks like the ServiceKey is the primary key for the table, and you almost certainly don't want that to be editable. I'm wondering if that is at least part of the problem.
2) This is a known issue unfortunately. Let me get back to you on that one!
Regards,
Allan
ServiceKey is Unique and an int, thus i just defined it as primaryKey and it should be editable. However i can add an autoincrement primary and change the ServiceKey it to unique if this migth be the problem.
PHP Code:
I now added a column called id as PK/Autoincrement and changed the PrimaryKey filed in php to "id". The Problems is still the same.
Editor::inst( $db, "camelrouting2", "id" ) ->fields(
Here the new version: http://sils.convercom.ch/datatablesPkAuto/
php for PkAuto:
Super - thanks for the updates!
This is very certainly a bug in Editor. Basically it wasn't waiting for the table to redraw when in server-side processing mode. I have a fix that will be in the next release, but if you would like to apply it immediately, in the Editor JS file find the following:
and replace with:
Its a bit more complicated, that should do the job internally.
There is one change needed externally as well:
needs to be changed to:
and
to
The reason for this is that when server-side processing is enabled when the table is redrawn it the DOM elements are destroyed and new ones created - so
this
, i.e. the original cell clicked on, no longer exists! Using the cell index resolves this.I will abstract that out in a future version, but that is a fair amount of work most likely rather than a little bug fix.
Let me know how you get on with it!
Regards,
Allan
Hi Allan,
Thanks for the help. This solves both Problems.
kindly,
Marcel