グリッドを作成するコード:
var grid = $("#grid").kendoGrid({
dataSource: [],
columnMenu: true,
scrollable: true,
sortable: false,
filterable: true,
groupable: true,
columns: [{
field: "Id",
title: "Id",
filterable: false
}, {
field: "title",
title: "Title"
}]
}).data("kendoGrid");
Array のプロトタイプも次のようにカスタマイズしました。
Function.prototype.method = function (name, func) {
"use strict";
if (!this.prototype[name]) {
this.prototype[name] = func;
return this;
}
};
Array.method('contains', function (object) {
return $.inArray(object, this) !== -1;
});
結果: 任意の列の列メニューを開こうとすると、次のようになります。
Uncaught TypeError: Cannot call method 'replace' of undefined
http://jsfiddle.net/lhoeppner/sNdVR/でバグのデモを参照してください。