jquery - i want to set focus on grid column in kendo -
i try check table column value when lost focus them.
made 1 demo show , easy understand.
link. http://jsbin.com/oqeral/16/edit
here try check column value if true grid refresh or else.
when false want set focus on last focus-out field.
here simple jquery. made in edit time kendo grid.
edit: function(e) { $('table').find('tr').mouseover( function(){ var row = $(this).find('td:eq(1)'); var box = $(row).find('input'); $(box).focusout(function(e){ if($(box).val() == 'hood') { alert('its hood'); } else { alert('not hood'); } }); }); } here alert value hood lost focus hood column.
if not hood again focus in on un hood column.
how can this. in kendo grid.
thanks.
you should use 'save' event.
http://docs.kendoui.com/api/web/grid#events-save
so in case
var t = $("#grid").kendogrid({ datasource: { data: users, pagesize: 10 }, pageable: true, selectable: "multiple row", toolbar: ["create"], columns: [{ field: "userid" }, { field: "username" }, { field: "isadmin" }, { command: "destroy", title: " ", width: "100px" }], editable: true, save: function (e) { // here have name before edit console.log('name was: '+e.model.username); // e.values have new values user gave console.log('new name: '+e.values.username); // if user has not given 'hood' name example... if(e.values.username!=='hood'){ // make check , if want prevent saving can example e.preventdefault(); } } });
Comments
Post a Comment