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
315
How do I ensure the grid is fully loaded on the page?
posted

I am new to using Infragistics controls.

I have a WHDG and I want to execute some code on client-side referencing the grid control. I use the jQuery API to determine when the page DOM is fully loaded perform some action. But I get 'grid' as null.

$(document).ready(function() {
        var grid = $find("wsHierarchyEditGrid");       
        loadContentUsingSelectedRow();
    });

Can anyone please advice how to ensure the loading of Infra grid control before any code execution?

Thanks!

 

  • 4275
    Offline posted

    Hello, sp22403.

    To be sure that you have the control in the DOM, just use the client-side events of  WHDG, in this case Initialize one. See this code, and I hope it will helps you.

    In ASPX:

    <ig:WebHierarchicalDataGrid ID="whdgSample" runat="server">
          <ClientEvents Initialize="whdgSample_Initialize"/>
     </ig:WebHierarchicalDataGrid>

    and the following handler holds the control as parameter:

            function whdgSample_Initialize(sender, eventArgs) {
                var grid = sender;   
            }

    Also you can use the following method, but when the control is already in the DOM:

    var grid = $IG.WebDataGrid.find('<%= whdgSample.ClientID %>');

    I hope this will help you.