jQWidgets Forums
jQuery UI Widgets › Forums › Grid › end editing after editor dropdown closes
Tagged: grid dropdownlist cellendedit
This topic contains 3 replies, has 2 voices, and was last updated by Hristo 5 years, 3 months ago.
-
Author
-
Hi,
standard behavior of a jqxgrid is that cellendedit is called when an editable column of a different row is selected.
I have just one editable column in my grid. the editor is a dropdownlist. I would like that editing stops and cellendedit is called as soon I have selected a new value in the dropdownlist. is this possible?this is my definition of the column:
{
text: ‘Status’, datafield: ‘status’, width: 120, columntype: ‘dropdownlist’, cellbeginedit: function (row, datafield, columntype, value)
{
if (value === ‘Deleted’||value ===’Canceled’) {
return false; //Disable Editing if status is Deleted or canceled
}
},
createeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight) {
var dataSource;
dataSource = [ ‘Tentative’, ‘Nieuw’, ‘Approved’,’Deleted’, ‘Processed’ ];
editor.jqxDropDownList({ source: dataSource });
}
}Hello RobWarning,
You could achieve this as you implement the logic as you bind to the
select
event of the jqxDropDownList in thecreateeditor
callback.
Please, try this suggestion and if you have any questions feel free to ask.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comI have tried this:
createeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight) { var dataSource; dataSource = [ 'Tentative', 'Nieuw', 'Approved','Deleted', 'Processed' ]; editor.jqxDropDownList({ source: dataSource }); editor.jqxDropDownList.on('select', function () { alert('end editing'); }); }
But the alert will not trigger. maybe I am binding the event on a wrong way?
also this has no effect:
createeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight) { var dataSource; dataSource = [ 'Tentative', 'Nieuw', 'Approved','Deleted', 'Processed' ]; editor.jqxDropDownList({ source: dataSource, select: function () { alert('end editing'); } }); }
Hello RobWarning,
Please, try to bind on that way:
editor.on('select', function () { alert('end editing'); });
Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.