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
615
WebDialogWindow in row editing template
posted

I'm trying to add a WebDialogWindow to the row editing template (by adding it to the template via the designer), but it's only being shown once: when editting a row for the first time. I close the WebDialogWindow with the close button and then start editing the second row, but then the window isn't show. I guess I have to set the windowstate of the WebDialogWindow manually in the "TemplateOpening" event, but I don't know how to get the clientId of the WebDialogWindow (so I can call the show() method on the window).

So my question is: is my assumption right and how do I get the clientId of the WebDialogWindow? Or is there another way to achieve this?

Parents
  • 24497
    Verified Answer
    posted

    Hi Pieter,

    To get access to javascript object of any control (regardless of its location), you should use functions related to that control only. WebDataGrid template or any other container is irrelevant to it.

    The $find(ClientID_ofControl) should be used. In case of naming containers, the value of ClientID can be hard to obtain. To get it, you can process ClientEvents.Initialize for that "child" control, and using reference to object within that handler, get its id, save it in a global variable and use that within $find at the time when you need reference.

    The Infragistics._Utility class (static variable $util) has a helper function findControl which can work only for Infragistics controls. However, in case of controls with same ids, it will find the first instance only. So, in general case it will fail. If ID of control in your application is unique, then it can be used reliably.

    Assume that template of row has WebDialogWindow with ID='WebDialogInsideRowEdit' and you have

    <RowEditingClientEvents TemplateOpening="grid1_templateOpening" />

    To ensure visibility of dialog, you may use something like below.

    <script type="text/javascript">
    function grid1_templateOpening(sender, args)
    {
      
    var dialog = $util.findControl('WebDialogInsideRowEdit');
      
    if(!dialog)
       {
          alert(
    'WebDialogInsideRowEdit was not found');
          
    return;
       }
      
    if(dialog.get_windowState() != $IG.DialogWindowState.Normal)
           dialog.set_windowState($IG.DialogWindowState.Normal);
    }
    </script>

Reply Children
No Data