This question is locked. New answers and comments are not allowed.
Hi everybody, in my project I'm notice a strange behaviour of the exec command insertHtml. This is my situation:
I have tWindow (created client side) with an editable (in-line) tGrid. Three of the tGrid columns being edited with tEditor, in the tEditor I've configured some snippets (that works always good) and some custom buttons that use insertHtml exec command to... insert html at the cursor position :).
One of this custom buttons before executing the insertHtml command opens a new modal tWindow (again created client side). This window has a tDropDownList to let the user to choose which html have to be inserted; when the window is closed I call the exec function of the tEditor to insert the selected value of the tDropDownList.
Now the strange behaviour is that if the user didn't open the tDropDownList but just close the modal tWindow, everything works good (for debug purpose I always add an html string). On the other side if the user open the tDropDownList , choose an element and then close the modal tWindow, the selected element is added on the top left of the editor (as first word) and not at the cursor position.
I call exec insertHtml in the "close" event of the tWindow. This is the js function that handle the click of the custom button and opens the modal tWindow:
Can someone please help me?
Thanks to all
I have tWindow (created client side) with an editable (in-line) tGrid. Three of the tGrid columns being edited with tEditor, in the tEditor I've configured some snippets (that works always good) and some custom buttons that use insertHtml exec command to... insert html at the cursor position :).
One of this custom buttons before executing the insertHtml command opens a new modal tWindow (again created client side). This window has a tDropDownList to let the user to choose which html have to be inserted; when the window is closed I call the exec function of the tEditor to insert the selected value of the tDropDownList.
Now the strange behaviour is that if the user didn't open the tDropDownList but just close the modal tWindow, everything works good (for debug purpose I always add an html string). On the other side if the user open the tDropDownList , choose an element and then close the modal tWindow, the selected element is added on the top left of the editor (as first word) and not at the cursor position.
I call exec insertHtml in the "close" event of the tWindow. This is the js function that handle the click of the custom button and opens the modal tWindow:
function
SetValueInEditorFromComplex(e, objTextarea, url, winTitle) {
var
lookupWindow;
var
evt = $.Event(e);
evt.stopPropagation();
evt.preventDefault();
lookupWindow = $.telerik.window.create({
name:
"RuleSetGetAgeWindow"
,
title: winTitle,
contentUrl: url,
modal:
true
,
resizable:
true
,
draggable:
true
,
onClose:
function
(ev) {
var
hd = lookupWindow.find(
'#hdValue'
);
var
editor = $(
'#'
+ objTextarea).data(
'tEditor'
);
editor.focus();
if
(hd && hd.val !=
''
) {
editor.exec(
'insertHtml'
, { value:
'Age('
+ hd.val() +
')'
});
}
lookupWindow.data(
'tWindow'
).destroy();
}
});
lookupWindow
.css({
left: window.mouseXPos + 50,
top: 5
})
.data(
'tWindow'
)
.open();
lookupWindow.focus();
}
Can someone please help me?
Thanks to all