This is a migrated thread and some comments may be shown as answers.

[Solved] Double Click Hierarchy Edit

1 Answer 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chad
Top achievements
Rank 1
Chad asked on 04 Mar 2008, 09:10 PM
Hi.  I'm trying to show the inplace edit template of a detail table 1 level down from the MasterTableView and I'm having difficulties.  I've tried using the example at..

http://www.telerik.com/community/code-library/submission/b311D-keegd.aspx

but that seems to not work with the Prometheus Grid.  I've also tried modifying the code sample on the demos page for double click editing but that is only for non hierarchy grids.   

Here is the current script for non hierarchy grids that I am trying to use.  Can anybody give me any suggestions on how to make this work?

Thanks

        <script type="text/javascript">  
        <!--  
         var hasChanges, inputs, dropdowns, editedRow;  
              
         function RowClick(sender, eventArgs)  
         {  
             if(editedRow != null && hasChanges)  
             {  
                 if(confirm("Update changes?"))  
                 {  
                     hasChanges = false;  
                     $find("<%= grdChecklist.MasterTableView.ClientID %>").updateItem(editedRow);  
                 }  
                 else 
                 {  
                     hasChanges = false;  
                 }  
             }  
         }  
 
         function RowDblClick(sender, eventArgs)  
         {  
                if(editedRow && hasChanges)  
             {      
                 if(confirm("Update changes?"))  
                 {  
                     hasChanges = false;  
                     $find("<%= grdChecklist.MasterTableView.ClientID %>").updateItem(editedRow);  
                 }  
                 else 
                 {  
                     hasChanges = false;  
                 }  
             }  
             editedRow = eventArgs.get_itemIndexHierarchical();  
             $find("<%= grdChecklist.MasterTableView.ClientID %>").editItem(editedRow);  
         }  
 
         function GridCreated(sender, eventArgs)  
         {  
         var gridElement = sender.get_element();  
         var elementsToUse = [];  
             inputs = gridElement.getElementsByTagName("input");  
             for (var i = 0; i < inputs.length;i++)  
             {  
             if(inputs[i].type.toLowerCase() == "hidden")  
             {  
                        continue;  
             }  
                   
             Array.add(elementsToUse, inputs[i]);  
                 inputs[i].onchange = TrackChanges;  
             }  
                  
             dropdowns = gridElement.getElementsByTagName("select");  
             for (var i = 0; i < dropdowns.length;i++)  
             {  
                 dropdowns[i].onchange = TrackChanges;  
             }  
 
             setTimeout(function(){if(elementsToUse[0])elementsToUse[0].focus();},100);  
         }  
 
         function TrackChanges(e)  
         {  
             hasChanges = true;  
         }  
     -->      
    </script> 

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 11 Mar 2008, 11:46 AM
Hi Chad,

Find the updated version of this code library. There is a sample project showing edit-on-double-click in hierarchy with RadGrid and RadAjax "Prometheus".

Best regards,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Chad
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or