jQuery UI Widgets › Forums › Grid › textBox editor focus on grid
This topic contains 5 replies, has 2 voices, and was last updated by ivailo 9 years, 8 months ago.
-
Author
-
i am using jqxInput as a editor for one of the columns.. but when user clicks on that cell.. it brings on editor mode.. but then when user clicks on different cell (without entering value in editable cell).. this textbox is still in focus… is there a way i can call focusout or something to take focus away from editing cell ?
below is my code :
function createEditor(row, cellvalue, editor, cellText, width, height){
var inputElement = $(“<input style=’float:right;margin-top: 4px;border:1px solid #6F93B9;box-shadow: inset 0 0 2px 2px #E5E5E5;border-radius:0′ />”).prependTo(editor);
var w = (width * 0.8);
var h = (height * 0.8);
inputElement.jqxInput({width: w, height: h});
}
function initEditor(row, cellvalue, editor, celltext, pressedkey){
//set the editor’s current value. The callback is called each time the editor is displayed.
var inputField = editor.find(‘input’);
if (pressedkey) {
inputField.val(pressedkey);
inputField.jqxInput(‘selectLast’);
}
else {
inputField.val(cellvalue);
inputField.jqxInput(‘selectAll’);
}
}
function qtyEditorValue(row, cellvalue, editor){
return editor.find(‘input’).val();
}Hi jahnvi25,
Your presented code looks fine(it’s almost the same as the cellcustomediting demo.
Try to upgrade to the last version 3.8.0 and if this doesn’t help attach a fiddle.
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comhere is the code.. which shows my situation.. steps to re-create
fiddle link http://jsfiddle.net/uuW2H/219/
1. run below code. (i modifiedbindingtoarray to my needs)
2. quantity field is editable with ‘0’ as default value.. click on cell..to bring in edit mode.. then click backspace to delete that ‘0’ .. dont press any other key.. now click on firstname cell (which has cellclick event attached to it).. on the same row…you will notice that quantity cell is still in edit mode.. and its not even updating value which i am trying to set via clicking on firstname column cell..i you click any other row and click on first name.. qty cell will update value..
how can i fix this..
Hi jahnvi25,
I made some changes to your code.
You can see the final solution in this fiddle.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comi created that sample program to our needs.. our requirement is such that we can not use numberinput(like in updated fiddle) as qty field editor and we have to allow ‘null’ as default value..or acceptable value.. in that case provided solution would not work..right ?
Thanks
Hi jahnvi25,
You can use
columntype: 'input'
to allow ‘null’.
Here is the fiddle.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.