kendo ui - Must programatically set a grid to editable=false -


super easy concept !...

at point, editable grid, (and detail grids), must set read only... like:

var grid = $("#grid").data("kendogrid"); grid.options.editable = false; 

of course doesn't work simple...

thanks !

i propose having 2 grids: 1 read-only , 1 read-write 1 visible. both share datasource definition, in sync. when want change 1 other, hide visible , display other.

example: create 2 grids, same definition , differ in 1 hidden , 1 visible, 1 editable , 1 not. since both share same datasource works perfect because changing page in 1 changes in other, editing one, updates other.

something like:

1- css definition used toggling visibility:

.ob-hide {     display : none; } 

2- datasource definition:

var ds = new kendo.data.datasource({     transport : {         read : {             url: ...         },         update : {             url: ...         },         create : {             url: ...         },         destroy : {             url: ...         }     },     pagesize: 10,     schema  : {         model: {             id : ...,             fields: {                 id       : { type: '...' },                 ...             }         }     } }); 

next 2 grids:

$("#grid-editable").kendogrid({     editable: "inline",     datasource : ds,     ... }  $("#grid-not-editable").kendogrid({     editable: false,     datasource: ds,     ... });  $("#grid-editable").addclass("ob-hide"); 

and function switching modes:

function grideditable() {     $("#grid-editable").removeclass("ob-hide");     $("#grid-not-editable").addclass("ob-hide"); });  function gridnoteditable() {     $("#grid-editable").addclass("ob-hide");     $("#grid-not-editable").removeclass("ob-hide"); }); 

see running here: http://jsfiddle.net/onabai/bcejr/2/


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -