__doPostBack to Editor?

Last post 11-23-2010, 9:15 PM by cutechat. 3 replies.
Sort Posts: Previous Next
  •  11-11-2010, 5:11 AM 64972

    __doPostBack to Editor?

    From javascript, using __doPostBack(object,argument);
     
    What do I specify as 'object' so that the cuteeditors' OnPostBackCommand event gets fired?
     
    What do I specify as 'argument' so that the OnPostBackCommand event recieves the same style of CommandEventArgs as the Save button posts back?
  •  11-11-2010, 8:21 PM 64980 in reply to 64972

    Re: __doPostBack to Editor?

    Hi Tobster,
     
    You can fire the PostBackCommand of editor by the code below. editor1 is the ID of CuteEditor in the page.
     
    __doPostBack("editor1$PostBackHandler");
     
    But I suggest you use "ExecCommand" to fire the PostBackCommand event, like below
     
     var editor1=document.getElementById("<%= editor1.ClientID %>");
     editor1.ExecCommand("PostBack",false,"myCommand");
     
    "myCommand" is the  "e.CommandName" you can get in  event PostBackCommand.
     
    Regards,
     
    ken
     
     
  •  11-12-2010, 2:58 AM 64985 in reply to 64980

    Re: __doPostBack to Editor?

    That's brilliant, thanks.
     
    Out of curiosity, what is the boolean second parameter in ExecCommand?
  •  11-23-2010, 9:15 PM 65142 in reply to 64985

    Re: __doPostBack to Editor?

    Hi,
     
    the second parameter is for compability of IE's execCommand method.
     
    For most conditions it's not used.
     
    Regards,
    Terry
     
View as RSS news feed in XML