Hi All,
I need to add child rows to the parent row in an Ultrawebgrid when the user clicks on the Expand [+] button. This needs to be done in the Javascript. I am making an Ajax call and getting the child rows data. How can I achieve this? Please reply as soon as possible as it is blocking further development. Thank you.
In case you are looking for a load on demand function you might consider using a WebHierarchicalDataSource and enable LoadOnDemand on the grid. Otherwise, you can handle some of the client side events, retrieve the expanded row and add a new row to the rows collection:
<
ClientSideEvents AfterRowExpandedHandler="OnRowExpanded"/>
<script type="text/javascript" language="javascript">
function OnRowExpanded(gridName, rowId) {
var row = igtbl_getRowById(rowId);
var rows = row.getChildRows();
row.addNew();
}
</script>
Note that you would also need to set AddNewRowDefault's Visible property to Yes.
Let me know if this is similar to your scenario.
I am getting the error "Object does not support this property or method" at the line
row.addNew()
Please let me know what is the cause. I am still not able to get a solution