Adding rows in a particular context doesn't work
Adding rows in a particular context doesn't work
mysthiq
Posts: 4Questions: 1Answers: 0
As said in that post on StackOverflow ...
http://stackoverflow.com/questions/33871984/datatables-using-fncreatedrow-to-add-details-rows
When i use
dataTable.row.add($myRow);
It gives me that error :
TypeError: invalid 'in' operand a
If I remove the fourth td of the row that I want to add... there is no error.
In my JSON response from the server, the fourth column contains an array of array that contains the sub rows that I want to add via the createdRow
callback.
Any idea ?
This discussion has been closed.
Answers
Were gonna need the content of
$myRow
...Whi h if youre following the common variable naming structure, the
$
means its a jQuery object, which wouldnt be right, it needs to be an array or objectHere it is !
nRow being the first parameter of the callback
createdRow
...I saw that in a comment of the
row.add()
page that we can put a jQuery object :https://datatables.net/reference/api/row.add()
I have succeed to make it work on a simple example in a fiddle http://jsfiddle.net/0f9Ljfjr/740/
So...yes it's possible.
It works now ...but I don't know what i'd changed ... So i can't give the answer for others :(