我一直在寻找一种方法,尽管很老套,将甘特图的任务模板连接到 ObservableObject 以利用 MVVM 系统。我知道编辑模板开箱即用地支持此功能,但是我一直在努力使其也可以与任务模板一起使用。
感谢 Josh Eastburn 和他的小提琴,我发现 Kendo Grid 中的细节模板可以通过 hooking 函数绑定到 MVVM detailInit
。
$("#a-kendo-grid").kendoGrid({
detailTemplate: kendo.template( $("#detail-template").html() ),
detailInit: function(e) {
kendo.bind(e.detailRow, e.data); // this line produces the binding
}
})
在实例化 Kendo Gantt 时,我乐观地尝试更改参数名称以引用任务而不是详细模板,但它似乎没有实现。
有没有人遇到过另一个将甘特图的任务模板绑定到 MVVM 的黑客/技巧?