i think it's bug

i think it's bug

TrollchikTrollchik Posts: 80Questions: 1Answers: 0
edited September 2011 in General
Hey. I try to use server side processing. And i use array of objects as the data source . So when i call
fnAddData i don't fet anything as return parameter. But if i use server side processing + array of arrays as a returned data, everuthing is ok!

what is the problem ?

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    fnAddData isn't going to do very much when you are using server-side processing. It will add the row on the client-side, but since DataTables doesn't know anything about your sever-side environment, it isn't going ot be added there - then when fnAddData does a redraw (which it does by default) your new row will be wiped out! So what you really want to do is make an Ajax call to add the data to the server (presumably a database) and then just call fnDraw.

    Allan
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    thanks for response!
    i need the next, i get array of objects from the server, and do next:

    [code]
    oTable.fnClearTable();
    var aiData = oTable.fnAddData(json.aaData);
    [/code]

    and after i need to make a specific cells editable. So i thought that i can get row which was added and make somethink like
    [code]
    specificCell.editable(editNumberFunction,
    {
    indicator: 'Changing value...',
    tooltip: 'Double-click to edit value...',
    event: 'dblclick',
    height: "14px"
    });
    [/code]

    how can i do it ?
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    i think i done it. i do
    [code]
    j('td.editableNumberValue', oTable.fnGetNodes()).editable(editNumberFunction,
    {
    indicator: 'Changing value...',
    tooltip: 'Double-click to edit value...',
    event: 'dblclick',
    height: "14px"
    });
    [/code]
    in the fnRowCallback !
  • TrollchikTrollchik Posts: 80Questions: 1Answers: 0
    edited September 2011
    hey, i meet another problem!
    when i use oTable.fnAddData(json.aaData); the search doesn't work by this new rows!

    how can i add this new rows to the search ?
  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    I don't quite understand - you specifically said you were using server-side processing. As I noted fnAddData won't work with server-side processing, since all the searching and data storage is done on the server side.

    Allan
This discussion has been closed.