List JS plugin get data from selected row(s)

Status
Not open for further replies.

m6xmed5

Member
From the wiki I can see that I can select any row I like and use the data from it
JavaScript:
var myelement = listdata[0][2] .data.yourtable___yourelement;
That is useful if I always want to reference the same row.

How is it done for selected rows?
If I want to use the data only from rows that checkboxes are checked is there some placeholder I can use instead of defining a row id? e.g

JavaScript:
var myelement = listdata[0][rowidplaceholder] .data.yourtable___yourelement;
 
You have two variables:

ids is an array of selected row ids.

rows is an object, keyed by rowid, with each entry being an object containing the row data

The simplest way to access the row data for every selected row would be ...

Code:
jQuery.each(rows, function(rowid, row) {
   // echo the value of yourtable___yourelement to the console
   fconsole(row.yourtable___yourelement); 
})

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top