What's new or change log???? and CuteEditor_OnCommand(editor,command,ui,value)

  •  01-25-2008, 6:46 AM

    What's new or change log???? and CuteEditor_OnCommand(editor,command,ui,value)

    Is there anywhere that details the changes from v5.3 to 6.0...
     
    As we've just had to fix a bug pointed out by a client (very embarasing)
    Which invloved the new handleevent on the client side
     
    eg the CuteEditor_OnCommand(editor,command,ui,value)!!! for which there is nothing in the developer guide!
    (and no example on the site, but there is an example in the howto?)
     
    Where we previously had to do something like
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Editor1.Attributes["oncommand"] = "HandleEditorCommand(this)";
     // add javascript
     ClientScriptManager cs = Page.ClientScript;
     if (!cs.IsStartupScriptRegistered("DeleteConfirm"))
     {
      String strScript = @"
       function HandleEditorCommand(editor)
        {
         if(event.command=='PostBack')
         {
          if (event.commandvalue=='DeleteItem'){
           event.returnValue = confirm(""Are you sure you wish to delete this item any child items will also be deleted? \n\n Deleted items can not be retrieved."");
          }else if (event.commandvalue=='DeleteItemPromote'){
           event.returnValue = confirm(""Are you sure you wish to delete this item any child items will be promoted? \n\n Deleted items can not be retrieved."");
          }
         }
        }";
     }
     
    Can you confirm that the correct approach is now
     
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    ClientScriptManager cs = Page.ClientScript;
    if (!cs.IsStartupScriptRegistered("DeleteConfirm"))
    {
     String strScript = @"
      function CuteEditor_OnCommand(editor,command,ui,value)
      {
        //handle the command by yourself
        if(command.toLowerCase()==""postback"")
        {
          if (value=='DeleteItem'){
        return !confirm(""Are you sure you wish to delete this item any child items will also be deleted? \n\n Deleted items can not be retrieved."");
         }else if (value=='DeleteItemPromote'){
        return !confirm(""Are you sure you wish to delete this item any child items will be promoted? \n\n Deleted items can not be retrieved."");
         }
         //alert(""The Save Command is Captured at the client side. You can hook up your business logic here.\n You can also stop this command."");
         //return true;//return true if you want to stop the command
        }
      }";
    }
    With the slightly annoying change of a return true now halts the event, rather than previously (and perhaps more logical in my eyes) as return false.
     
    cheers
    Mike
View Complete Thread