Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Ultrawebgrid: Adding rows to child band from javascript
posted

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.

Parents
No Data
Reply
  • 9836
    posted

    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.

     

Children