I'm getting close on this, but I just can't seem to make the final step.
I have a label outside my grid that I want to populate with the number of rows in the grid via client-side scripting.
I have my ClientSettings defined with:
I have a JavaScript with the following:
The reason I have get_pageCount() in there was just to make sure I could populate the label. What I want to put in that label is the number of rows in the grid.
I found previous examples of people using Rows.length or MasterTableView.Rows.length, but these throw an error. I think they may have been for the non-Promethius version of the grid.
Can anyone point me in the right direction to get this number? Can I loop through the grid rows somehow to count them or is there any property I can access that will give me what I'm looking for? I need this to be client side so that I can update the row count when a record is added or deleted. Thanks.
I have a label outside my grid that I want to populate with the number of rows in the grid via client-side scripting.
I have my ClientSettings defined with:
| <Selecting AllowRowSelect="true" /> |
| <ClientEvents onGridCreated="GridCreated" /> |
I have a JavaScript with the following:
| function GridCreated(sender, eventArgs) |
| { |
| var label = document.getElementById('ctl100_MainContent_gridCount'); |
| var grid = sender.get_masterTableView(); |
| label.innerHTML = grid.get_pageCount(); |
| } |
The reason I have get_pageCount() in there was just to make sure I could populate the label. What I want to put in that label is the number of rows in the grid.
I found previous examples of people using Rows.length or MasterTableView.Rows.length, but these throw an error. I think they may have been for the non-Promethius version of the grid.
Can anyone point me in the right direction to get this number? Can I loop through the grid rows somehow to count them or is there any property I can access that will give me what I'm looking for? I need this to be client side so that I can update the row count when a record is added or deleted. Thanks.
