Edit on double-click demo error

5 posts, 0 answers
  1. Joseph
    Joseph avatar
    9 posts
    Member since:
    Feb 2008

    Posted 25 Aug 2008 Link to this post

    I was looking at ideas for a project I'm currently working on - and I was trying out some stuff on your demo site.  Specifically, the demo which shows how to edit on double-click.  While doing so, I found a possible issue.

    Here are the steps to recreate the issue:

    1) Goto: http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/EditOnDblClick/DefaultCS.aspx
    2)  Double click on a row to edit it.
    3) Make a change to the data
    4) Click on the pager to navigate to page 2
    5) Click on the pager to navigate back to page 1
    6) Double click on the same row to edit it - you will get a popup which asks Update Changes?
    7) Click OK
    8) Site error message displays.

    I'm just guessing here, but it seems like using the pager to navigate doesnt trigger a check to see if the data has changed - but when you come back to the page and double-click - it knows the data was changed but that data is now inaccessible and the update fails.
  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 27 Aug 2008 Link to this post

    Hello Joseph,

    I just tried that but cannot get the error:

    http://demos.telerik.com/aspnet/prometheus/Grid/Examples/DataEditing/EditOnDblClick/DefaultCS.aspx


    I change the data the first time, but does not submit the change, should I? Moving forth and back to the same page and changing/updating the same value functions properly and the value is updated without any error.

    The demo runs with the new version of RadControls for ASP.NET AJAX Q2 2008 Service Pack 1 but we have not changed the demo recently. Let us know if I'm missing a detail from the required steps.

    All the best,
    Konstantin Petkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Roy
    Roy avatar
    36 posts
    Member since:
    Jun 2008

    Posted 27 Aug 2008 Link to this post

    I have the same problem...
    I checked it again on the demo, and it has the same problem.
    Scenario:
    Dblclicked a row, changed a value, paged without saving,
    paged back, edited the same row again, and boom...
  5. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 27 Aug 2008 Link to this post

    Hi,

    Indeed, I was able to reproduce the error. We will investigate it as soon as possible and find a way to resolve that.

    Thank you for notifying us about that, guys!

    All the best,
    Konstantin Petkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 27 Aug 2008 Link to this post

    Hello,

    Just a follow-up -- the problem is already addressed. You will the live demo updated shortly as well. The JavaScript is updated as follows:

            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
            <script type="text/javascript"
            <!-- 
                var hasChanges, inputs, dropdowns, editedRow; 
                 
                function RowClick(sender, eventArgs) 
                { 
                    if(editedRow && hasChanges) 
                    { 
                        hasChanges = false
                        if(confirm("Update changes?")) 
                        { 
                             
                            $find("<%= RadGrid1.MasterTableView.ClientID %>").updateItem(editedRow); 
                        } 
                    } 
                } 
     
                function RowDblClick(sender, eventArgs) 
                { 
                    editedRow = eventArgs.get_itemIndexHierarchical(); 
                    $find("<%= RadGrid1.MasterTableView.ClientID %>").editItem(editedRow); 
                } 
     
                function GridCommand(sender, args) 
                { 
                    if (args.get_commandName() != "Edit") 
                    { 
                        editedRow = null
                    } 
                } 
     
                function GridCreated(sender, eventArgs) 
                { 
                    var gridElement = sender.get_element(); 
                    var elementsToUse = []; 
                    inputs = gridElement.getElementsByTagName("input"); 
                    for (var i = 0; i < inputs.length;i++) 
                    { 
                        var lowerType = inputs[i].type.toLowerCase(); 
                        if(lowerType == "hidden" || lowerType == "button") 
                        { 
                            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> 
        </telerik:RadCodeBlock> 

    where GridCommand is the handler of OnCommand client event:

    <telerik:RadGrid ...> 
        ... 
        <ClientSettings> 
            <ClientEvents ... OnCommand="GridCommand"/> 
        </ClientSettings> 
    </telerik:RadGrid> 

    Regards,
    Konstantin Petkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017