如何动态配置kendo网格 [英] how to configure kendo grid dynamically
问题描述
我为kendo网格创建了这个通用插件,我可以在多个网页(mvc)上使用它。现在有一个网页,它也使用这个插件,我想自定义(如从true到false可分组,可选属性从true到false)。但问题是我对所有应用了这个kendo-grid插件的网页进行了更改。我希望只对特定页面进行更改。请帮忙。在此先感谢
// 可配置的通用剑道网格
( function ($){
$ .fn。 GenericGridPlugin = function (configuration,readData,g_searchPageSize){
$( this )。kendoGrid( {
editable: false ,
pageable: true ,
sortable : true ,
groupable: true ,
autobind: false ,
autoSync: true ,
selectable: true ,
列:configuration.columns,
可导航: true ,
dataSource:{
serverPaging: true ,
serverSorting: true ,
transport:{
read:readData
},
pageSize:g_searchPageSize,
schema:{
data: function (response){
return response.Result;
},
总计:功能(响应){
返回 response.TotalRecords;
}
}
}
});
}
}(jQuery));
){
< blockquote> .fn.GenericGridPlugin = function (configuration,readData,g_searchPageSize){
( this )。kendoGrid({
editable: false ,
pageable: true ,
sortable: true ,
groupable: true ,
autobind: false ,
autoSync: true ,
可选: true ,
columns:configuration.columns,
navigatable: true ,
dataSource:{
serverPaging: t rue ,
serverSorting: true ,
transport:{
read:readData
},
pageSize:g_searchPageSize,
架构:{
数据:功能(响应){
返回 response.Result;
},
总计:功能(响应){
返回 response.TotalRecords;
}
}
}
});
}
}(jQuery));
i have created this generic plugin for kendo grid which i can use on multiple webpages (mvc). Now there is a web-page which is also using this plugin and which i want to make customised (like making groupable from true to false, selectable property from true to false). But the problem here is that i makes changes to all the web-pages where i have applied this kendo-grid plugin. i wish to make changes only to a particular page. PLEASE help. thanks in advance
// A generic kendo grid which is configurable
(function ($) {
$.fn.GenericGridPlugin = function (configuration, readData, g_searchPageSize) {
$(this).kendoGrid({
editable: false,
pageable: true,
sortable: true,
groupable: true,
autobind:false,
autoSync: true,
selectable: true,
columns: configuration.columns,
navigatable: true,
dataSource: {
serverPaging: true,
serverSorting: true,
transport: {
read: readData
},
pageSize: g_searchPageSize,
schema: {
data: function (response) {
return response.Result;
},
total: function (response) {
return response.TotalRecords;
}
}
}
});
}
}(jQuery));
) {
.fn.GenericGridPlugin = function (configuration, readData, g_searchPageSize) {
(this).kendoGrid({ editable: false, pageable: true, sortable: true, groupable: true, autobind:false, autoSync: true, selectable: true, columns: configuration.columns, navigatable: true, dataSource: { serverPaging: true, serverSorting: true, transport: { read: readData }, pageSize: g_searchPageSize, schema: { data: function (response) { return response.Result; }, total: function (response) { return response.TotalRecords; } } } }); } }(jQuery));
这篇关于如何动态配置kendo网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!