Datatables editor: Updates serverside but not local

Datatables editor: Updates serverside but not local

techbottechbot Posts: 9Questions: 4Answers: 0

Hi Allan,
http://sigs.emc23.com/players/

When I edit row number 63 (Techbot), the ajax is sent and the server saves the new value. But the cell doesn't react visibly to me pressing [return] and if I unselect the cell value returns to the original value ( tho' the value is now saved and can be viewed on refresh.)

Note: Only row 63 will work, I've hardcoded the value while testing.

(I've tried rearranging the order of the js and css files as I've noted the halfling glyphs don't show either, so I thought it might be my folder structure or file order)

*also how do I mark my previous question as answered?

thanks
Rob

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    Answer ✓

    Hi Rob,

    Thanks for the link. The issue here is that the server is not responding with the JSON format that Editor expects.

    Currently it is responding with a PHP array dump:

    Array
    (
        [action] => edit
        [data] => Array
            (
                [63] => Array
                    (
                        [name] => Techbot1
                    )
    
            )
    
    )
    name
    

    The format of the array looks good, it just needs to be sent back as JSON.

    *also how do I mark my previous question as answered?

    It looks like you've used the "New Discussion" button rather than "Ask a Question" so there is no way to mark these two threads as answered other than just to note it in a reply.

    Allan

  • techbottechbot Posts: 9Questions: 4Answers: 0

    Thanks Allan,

    got it all working now.

    I note that the json returned must be an array(rows) of array(values) even if only one record was edited.
    So in my case it was:
    $row[0]['DT_RowId'] = $record->getId();
    rather than
    $row['DT_RowId'] = $record->getId();

This discussion has been closed.