M
McGeeky
Hi. Is it possible to iterate through the items in a GridView using
JavaScript on the client?
JavaScript on the client?
Tasos Vogiatzoglou said:You can iterate through the visible items (represented by the
DomElement tableRow) with the following snippet...
<script>
var tableElement = document.getElementById('idOfTable');
for (var i=0;i<tableElement.rows.count;i++){
var rowElem = tableElements.rows;
for (var x=0;x<rowElem.cells.count;x++){
var cell = rowElem.cells[x];
//cell is a reference to the cell object from where you can
get the checkbox element
}
}
</script>
Regards,
Tasos
Great! Thanks for that. Is there are programmatic way to embed the ID of the
table in to the HTML file rather than hard coding it?
You can see that I am fairly new to this!
Thanks.
--
McGeeky
http://mcgeeky.blogspot.com
Tasos Vogiatzoglou said:You can iterate through the visible items (represented by the
DomElement tableRow) with the following snippet...
<script>
var tableElement = document.getElementById('idOfTable');
for (var i=0;i<tableElement.rows.count;i++){
var rowElem = tableElements.rows;
for (var x=0;x<rowElem.cells.count;x++){
var cell = rowElem.cells[x];
//cell is a reference to the cell object from where you can
get the checkbox element
}
}
</script>
Regards,
Tasos
Hi. Is it possible to iterate through the items in a GridView using
JavaScript on the client?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.