Datatables 1.10 - draw call Ajax with serverSide true

Datatables 1.10 - draw call Ajax with serverSide true

AleksAleks Posts: 8Questions: 0Answers: 0
edited February 2014 in General
Hi again,

I'm trying to make this example work with serverSide processing : http://datatables.net/dev/knockout/

The problem I'm facing is that draw() method is calling Ajax. I fell in infinite loop (ajax -> knockout array update -> subscribeArrayChanged -> draw -> ajax -> knockout array update -> subscribeArrayChanged -> etc.)

Is there a way to reflect the newly added row without calling the ajax again ?

Thank you.
Aleks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm honestly not sure how you would get Knockout and server-side processing working together. Surely the whole point of Knockout is that it is the data controller, but in DataTables server-side processing, it is the server that controls the data.

    It could probably be done, but I don't see how it could be the simplest solution!

    Allan
  • AleksAleks Posts: 8Questions: 0Answers: 0
    I will simply keep modified items and injecting them in server returned data when they are part of the filter elements.

    Anyway, is it possible to add a row without have ajax function called ?

    Aleks
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited February 2014
    > Anyway, is it possible to add a row without have ajax function called ?

    Not in server-side processing mode.

    The whole point of server-side processing is that DataTables doesn't have the data that it doesn't need for the current display at the client-side - thus it follows that it must make an Ajax call to get any other data. There is no option to add data to the table in server-side processing mode from the client-side - its up to the server to do that.

    Allan
This discussion has been closed.