How to update the table after filter the row containing a "primary key value".
How to update the table after filter the row containing a "primary key value".
Dear All,
I'm using "DataTables plug-in" to make HTML table.
Each row of this table has a "primary key value" which I want to use in order to upload other cells in the same row.
In practice the client is connected to a websocket which prompts data like this:
{"PKEY_STRING": ["cell1","cell2","cell3"] }
where the label is the "primary key value".
I tried with the following code but it doesn't work because oTable.fnFilter() doesn't give me the "row number" but just redraw the table.
[code]
var a = oTable.fnFilter( 'KEY_STRING' ); //fake code
var nTr = oTable.fnGetNodes( a[0] );
oTable.fnUpdate( ["cell1","cell2","cell3"], nTr , 0 );
[/code]
Best Regards,
thanks,
Antonio
I'm using "DataTables plug-in" to make HTML table.
Each row of this table has a "primary key value" which I want to use in order to upload other cells in the same row.
In practice the client is connected to a websocket which prompts data like this:
{"PKEY_STRING": ["cell1","cell2","cell3"] }
where the label is the "primary key value".
I tried with the following code but it doesn't work because oTable.fnFilter() doesn't give me the "row number" but just redraw the table.
[code]
var a = oTable.fnFilter( 'KEY_STRING' ); //fake code
var nTr = oTable.fnGetNodes( a[0] );
oTable.fnUpdate( ["cell1","cell2","cell3"], nTr , 0 );
[/code]
Best Regards,
thanks,
Antonio
This discussion has been closed.
Replies
I solved in this way, but i dont' know if the best way!!
[code]
$('table tr:contains("KEY_STRING")').each(function(){
oTable.fnUpdate('lalalal',(oTable.fnGetPosition(this)), 3)
})
[/code]
thanks,
Antoino