View Full Version : DynaMetapushTable - approaching a specific cell in javascript
shayzweig
02-09-2010, 11:56 AM
Hi,
using DynaMetapushTable - Is there any way to approach a specific cell that was automatically created by the table?
I want to create a table and for each row create a button that when pressed, will activate a javascript code on the specific row - for instance, delete it.
in order to do that I have to get the ID of the row - how can I do that?
thank you?
Shay
hi,
through the onChangingValues (http://www.lightstreamer.com/docs/client_web_jsdoc/DynaMetapushTable.html#onChangingValues) callback you can obtain the dom node of the updateing row (that is a clone of the template) as it is passed as the second parameter in the call, or, if setPushedHtmlEnabled (http://www.lightstreamer.com/docs/client_web_jsdoc/VisualTable.html#setPushedHtmlEnabled) is set to true, inject your html as the formatted value of one of the field (you could use a client-side field for this purpose with the addField (http://www.lightstreamer.com/docs/client_web_jsdoc/UpdateItemInfo.html#addField) method but note that setPushedHtmlEnabled must be true anyway for the entire table)
HTH
please also note that you should not remove rows client-side as with a DynaMetapushTable the results in doing so can be unpredictable, so do it at your own risk.
The correct way to remove a line from a DynaMetapushTable is to send a DELETE command from the server.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.