asp.net - Kendo ui checkbox bind -


user tabi have kendogrid displays roles. when click on edit of role opens pop window multiple tabs. on 1 of tab have users . tab displays list of users , checkbox checked if user has role. when check checkbox of other user role must assigned me user , save in database. how call method in service on onclick event of checkbox or there other way.

the error iam getting when click on checkbox says addroleusr() undefined. addroleusr() defined in service.below grid definition.

fron picture attached when click on user changes must saved on grid.

thanks

 function editeventgrid() {         editds = new kendo.data.datasource({             type: "json",             schema: {                 data: function (response) {                     return json.parse(response.d); // asmx services return json in following format { "d": <result> }.                  },                 model: {// define model of data source. required validation , property types.                     id: "userid",                     fields: {                         firstname: { editable: true, nullable: true, type: "string" },                         userid: { editable: true, nullable: false, type: "string" },                         roleid: { editable: false, nullable: false, type: "string" },                             }                 },             },             transport: {                 read: {                     url: "/services/erpnowservices.asmx/getusersroles", //specify url data should return records. read method of products.asmx service.                     contenttype: "application/json; charset=utf-8", // tells web service serialize json                     type: "post", //use http post request default not allowed asmx                     datatype: "json",                     data: getsearchcriteria()                 },                 update: {                     url: "/services/erpnowservices.asmx/updateusers",                     contenttype: "application/json; charset=utf-8",                     type: "post",                     datatype: "json"                 },                 parametermap: function (data, type) {                     if ((type == "read") || (type == "update") || (type == "destroy")) {                         console.log('parametermap: data => ' + json.stringify(data));                         return json.stringify(data);                                                 } else {                         return data;                     }                 }             }         });          usergrid = $("#users").kendogrid({             datasource: editds,             height: 450,             //databound: ondatabound,             pageable: false,             sortable: true,             binding: true,             serverfiltering: true,             editable: "inline",             autosync: true,              columns: [                {                  field: "firstname",                  title: "firstname",                  headertemplate: '<span class="tbl-hdr">firstname</span>',                  attributes: {                      style: "vertical-align: top; text-align: left; font-weight:bold; font-size: 12px"                  }                },                                  {                    field: "userid",                    title: "userid",                    headertemplate: '<span class="tbl-hdr">userid</span>',                    attributes: {                        style: "vertical-align: top; text-align: left; font-weight:bold; font-size: 12px"                    }                },                {                     //title :"check",                    template: kendo.template("<input type='checkbox'  # if(roleid){ # checked #} # onclick='addroleusr()'/>"),                   // template: "<input type=\"checkbox\" # if(rolename){ # checked #} # />",                    attributes: {                        style: "vertical-align: top; text-align: center;"                    }                },          ],             editable: true,         }).data('kendogrid'); 

}


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -