jQuery UI Widgets › Forums › Grid › column create editor with jqxNumberInput doesn't work
Tagged: cellsformat, column, columntype, custom editor, editor, geteditorvalue, grid, jqxgrid, jqxnumberinput, Number Input, numberinput, template
This topic contains 5 replies, has 2 voices, and was last updated by Dimitar 9 years, 7 months ago.
-
Author
-
Please revise this fiddle: http://jsfiddle.net/asharifullin/q22ubc8L/
The problem is with quantity field. When cell is active and in ‘editing’ mode I’ve got editor with value, but after editing I cannot hide custom editor by pressing tab, or esc, or anything else.
, {
text: ‘Quantity’,
datafield: ‘quantity’,
width: 80,
cellsalign: ‘right’,
initeditor: function (row, cellvalue, editor, celltext, pressedChar) {
editor.jqxNumberInput(‘val’, cellvalue);
},
geteditorvalue: function (row, cellvalue, editor) {
return editor.find(‘input’).val();
},
createeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight) {
editor.jqxNumberInput({
decimalDigits: 3,
width: cellwidth,
height: cellheight
});
},
destroyeditor : function(editor) {
editor.jqxNumberInput(‘destroy’);
},
cellsformat: “f3”,
columntype: “template”},
Hello asharifullin,
You have set up your ‘template’ column editor incorrectly. Please check out the demo Custom Column Editor which shows how to properly do so.
Note, however, that there is already a built-in jqxNumberInput editor. You just have to set the columntype to ‘numberinput’ (note the “Quantity” column in the demo Editing).
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks for the answer, but problem still exists. So, I’ve done almost everything like in the example above (Custom Column Editor). So, at this moment almost everything is working except callback method ‘geteditorvalue’ is not calling back. And therefore gridcell never get value from editor. Check this out please – http://jsfiddle.net/asharifullin/73hhov6f/ column quantity.
And, yes, I know about columntype of ‘numberinput’. But I would like to set editor with abilities to enter decimal digits like 0.978, but standard editor of ‘numberinput’ doesn’t do that.
Hi asharifullin,
The settings of the default editor can be modified however you like: http://jsfiddle.net/Dimitar_jQWidgets/s9kk5ye0/ in createeditor.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks a lot! Now it is working. But I didn’t understand why callback method geteditorvalue from that fiddle http://jsfiddle.net/asharifullin/73hhov6f/ didn’t work. Theoretically – it should.
Hi asharifullin,
The geteditorvalue callback is not called because cellsformat has also been set. If you remove it, geteditorvalue works as expected.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.