Each table entry contains other grid components and a DIV that contains more grid components.
Here's an example
The Labels are fed from a rest call to the DB, label2 is an array of labels and all are dynamically created as you would expect. This works well.
If the user taps on Button (which is within the table row dynamically created, how do I identify the name of the elements label1 and label2 so I can either modify or get their values/contents?
I've tried var lable1text = $(this).find("[name=label1]").text();
etc but it returns nothing.
Is the fact that the data is in a DIV causing me the problem?
Any help would be massively appreciated.
I also would like to know how you reference agrid within a div.
Please use the following JS code for that:
Code: Select all
var lable1text = $(this).closest("[name=my_grid]").find("[name=label1]").text();
here "my_grid" - the name of the grid, which are generated automatically with a mapping of the array you use here