dijit/InlineEditBox: How to set max characters per line

333 Views Asked by At

In Dojo's text editor (dijit/InlineEditBox) I need to set dynamically the maximum number of characters per line.

I suspect that "editorparams" could be used for that, but I can't find documentation or good examples about it.

Is it possible to set a maximum number of characters per line? If so, how?

1

There are 1 best solutions below

5
On

Yes, it is possible. editorParams should contain object with properties of editor, you're using in InlineTextBox.
See snippet below.
In this case editor is dijit/form/TextBox and its property maxlength is set to 10.

require(["dojo/parser",
         "dijit/InlineEditBox", 
         "dijit/form/TextBox" ], 
function(parser){
parser.parse();

});
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.9/dojo/dojo.js"></script>
<div id="editBox" data-dojo-type="dijit/InlineEditBox"  data-dojo-props="editor:'dijit/form/TextBox',
editorParams:{maxlength: 10}" >123456789</div>