Hallo,
i added a custom tool in the editor and am using it to add horizontal tab.
I'm using inserthtml for this, but after adding the tab span, the previous format isn't retained.
How can I add the span for tab inside the previous format span? Or in other words, how can I continue the previous format?
any ideas?
You can test it like this:
1- press the custom tab tool button to activate the tab key
2- enter a text and make font size eg. 16px
3- then press tab key on keyboard
4- then enter a new text again
formatting is lost
Example:
Tab on/off | Kendo UI Dojo (telerik.com)
function onTabKeyClicked(e){
if (isTabOn){
e.preventDefault();
editor.exec("inserthtml", { value: '<span style="white-space:pre;tab-size:0.25in;">	</span>' });
}
}
thank you in advance
editor.paste('<span style="white-space:pre;tab-size:0.25in;">	</span>', { split: false });
thanks everyone
unfortunately it didn't work, pressing the tab key after text2 moves the cursor to the beginning of tex2.
var editor = $(id).data("kendoEditor"); var range = editor.getRange(); editor.selectRange(range); editor.paste('<span style="white-space:pre;tab-size:0.25in;">	</span>', { split: false });
I think that's how it works, I'm testing it.
Hi Sebastian,
Another approach that you could test is to use the insertHtml command and insert the Tab using " ". Below is an example:
editor.exec("inserthtml", { value: " " });
Here is a Dojo where the behavior is demonstrated.
I hope this helps.
Regards, Neli