JQuery DataTables: How do I add a row ID to each dynamically added row?

Found the solution: datatables.net/forums/discussion/2119/ad... For anyone else wanting a quick solution, I did: var addId = $j('#mimicTable').dataTable(). FnAddData( alarmID, 'col2', 'col3', 'col4', 'col5' ); var theNode = $j('#mimicTable').dataTable().fnSettings(). AoDataaddId0.

NTr; theNode. SetAttribute('id','alarmNum' + alarmID).

There is something unexpected with your code in the jsbin, even if it appears to be working. It initializes with the "browsers" data set. Then it clears.

Then it makes a new table with one row. Then it clears. Then it makes a new table with two rows.

Then it clears. Then it makes a new table with three rows. I'd have to get a better sense of the code sample and its end goal (and alas my attention is diverted elsewhere right now) but you should be aware that fnRowCallback SHOULD be the way to do this, and that there are many redundant table constructions and row additions that are going to impact performance as well as flexibility with modifying rendering in the future.

Thanks for your answer, but have a look at the answer I posted. It works :) Performance appears to be ok, but I am going to do further tests. – psynnott Nov 24 at 9:25 Have you folded the updated code into the jsbin?

I'd be curious to poke around, too. I could help you find any anomalies. – Greg Pettit Nov 24 at 15:30.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions