I added a custom drop down to my editor. I created the OnClientCommandExecuting function to handle what happens when someone selects an item in the drop down.
The problem is the event fires when I press enter inside the editor, which is causing the following code to throw an error:
function
OnClientCommandExecuting(editor, args) {
var
name = args.get_commandName();
var
val = args.get_value();
var
info = val.split(
"::"
);
}
Error:
val is undefined
(?)(editor=Object { __msdisposeindex=3, _element=div
#RadEditor1.RadEditor, _clientStateFieldID="RadEditor1_ClientState", more...}, args=Object { _cancel=false, _commandName="EnterNewLine", _name="EnterNewLine"})TelerikAjax.aspx (line 23)
createCallback(c=Object { __msdisposeindex=3, _element=div
#RadEditor1.RadEditor, _clientStateFieldID="RadEditor1_ClientState", more...}, d=Object { _cancel=false, _commandName="EnterNewLine", _name="EnterNewLine"})Teleri...90a9d4e (line 6)
raiseEvent(b=
"commandExecuting"
, c=Object { _cancel=
false
, _commandName=
"EnterNewLine"
, _name=
"EnterNewLine"
})Core.js (line 766)
createCallback(a=Object { __msdisposeindex=3, _element=div
#RadEditor1.RadEditor, _clientStateFieldID="RadEditor1_ClientState", more...}, d="raiseEvent", b=["commandExecuting", Object { _cancel=false, _commandName="EnterNewLine", _name="EnterNewLine"}])Teleri...90a9d4e (line 6)
_responseReceived(c=
"commandExecuting"
, d=Object { _cancel=
false
, _commandName=
"EnterNewLine"
, _name=
"EnterNewLine"
})RadEditor.js (line 6416)
_executeCommandEvent(s=
"commandExecuting"
, u=
"EnterNewLine"
, j=Object { _cancel=
false
, _commandName=
"EnterNewLine"
, _name=
"EnterNewLine"
})RadEditor.js (line 7382)
fire(m=
"EnterNewLine"
, j=undefined)RadEditor.js (line 7363)
_onKeyDown(t=keydown charCode=0, keyCode=13)RadEditor.js (line 7814)
(?)(h=keydown charCode=0, keyCode=13)RadEditor.js (line 7739)
[Break On This Error]
Reload the page to get source
for
: http:
//localhost:56444/TelerikAjax.aspx
TelerikAjax.aspx (line 23)