Hello
In a grid i have a cell (col type: ‘txt’). If i edit this cell i want to mark some text and later make it bold, italic, underlined …
I have all buttons in my Toolbar and with pressing them i would like to change the marked text and put the specified expression around it.
Example:
Text = “This is a test”
marked = “a test”
result after pressing the bold button should be = “This is a Test”
How can i get the selected text from the cell?
Thank you and best regards
You may use the following solution to get the input of the cell editor:
<input type="button" onclick="(arguments[0]||window.event).cancelBubble=true;foo()" value="push">
...
var inp
...
mygrid.attachEvent("onEditCell", function(stage,rId,cInd,nValue,oValue){
if(stage==1 && mygrid.editor && mygrid.editor.obj){
inp=this.editor.obj
}
return true
});
function foo(){
console.log(inp);
}
In case of working with the html input selection: the question is not covered by dhtmlxgrid and depends on using libraries and supported browsers. Some solutions can be found here:
stackoverflow.com/questions/2377 … -a-textbox
Thank you
I tried a little bit and got a perfect solution 