Page 1 of 1

Finding the value of an element within a dynamic table

Posted: Thu Apr 14, 2016 10:22 am
by Andy Parker

I have a list that is filled from a REST DB source.

Each table entry contains other grid components and a DIV that contains more grid components.

Here's an example
Image
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.

My question:
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.


Re: Finding the value of an element within a dynamic table

Posted: Tue Oct 06, 2020 2:45 am
by anywhere

I also would like to know how you reference agrid within a div.


Re: Finding the value of an element within a dynamic table

Posted: Fri Oct 09, 2020 8:55 pm
by Serhii Kulibaba

Hello,

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