0
私のKENDOグリッドでグループ化可能なオプションを追加/削除するトグルボタンを作成します。初期化では、私は 'グループ化可能'プロパティを持っていません。角度付きの剣道グリッドでグループ化可能なオプションが動的に設定されない
{
type: "button",
togglable: true,
id: "groupableToggle",
toggle: function (e) {
var grid = $("#grid" + config.id).data("kendoGrid");
if (e.checked) {
grid.options.groupable = {
messages: {
empty: "drag a column header and drop it here to group by that column"
}
};
}
else
grid.options.groupable = false
grid._thead();
grid.refresh();
}
}
これは機能しません。
OK!見つけた!今
if (e.checked) {
grid.setOptions({
groupable: true,
messages: {
empty: "drag a column header and drop it here to group by that column"
}
});
}
else {
grid.setOptions({
groupable: false
});
}
grid._thead();
grid.refresh();
とはgroupable
設定がグリッドを再作成することなく、その場で変更することはできません
http://docs.telerik.com/kendo-ui/api/javascript/ui/widget#methods-setOptions IF(e.checked){ grid.setOptions({ グループ化可能:真、 メッセージ:{ 空の「列ヘッダーをドラッグして、グループにそれをここにドロップその列 " } });} } grid._thead(); grid.refresh(); – GomuGomuNoRocket
setOptions()の後に_thead()またはrefresh()を呼び出す必要はありません。 – dimodi