kendo ui是否支持嵌套數據源? 我有一個表格,我需要其中一列有一個嵌套的表格。我沒有使用json來填充。 在我能夠找到的任何小文檔中都說支持嵌套數據源,但是那些使用json。 如果有人能提供一個如何實現這個的例子,這將是非常有益的。Kendo UI中的嵌套數據源
1
A
回答
1
簡短的回答:是的,HierarchicalDataSource就是嵌套的普通數據源的實現。換句話說,每個「節點」是數據源的一個實例。
沒有一噸的HierarchicalDataSource是如何工作的文件;我個人不得不在源代碼中弄亂很多,以便處理它。劍道只使用它作爲樹形視圖,它似乎是專門爲它構建的。但是,通過改變傳遞給它的Node模型,您可以或多或少地獲得它的行爲。
您不能僅將此數據源與任何小部件一起使用,小部件需要在內部支持它。我個人不得不創建自己的listview實現來處理它,因爲我想要嵌套的CRUD。
0
這是一個簡單的listview實現,涵蓋了一個嵌套模板。雖然不完美,但它似乎是管理這一挑戰的最簡單方法。我還建議這個問題不明確。我正在努力回答我認爲的障礙。
// Parent ListView
<div id="parent-listview"></div>
// Parent template
<script id="parent-template" type="text/x-kendo-template">
<a>#=ParentDescription#</a>
// Child ListView
<div id="child-listview-#=Id#"></div>
</script>
// Child template
<script id="child-template" type="text/x-kendo-template">
<a>#=ChildDescription#</a>
</script>
// Bind Parent
$("#parent-listview").kendoListView(
{
template: $("#parent-template").html(),
data : parentData
dataBound: function(e) {
// Bind children
$.each(this.dataItems(), function(idx, item) {
bindChildListView(item);
})
}
});
// Bind each child item
function bindChildListView(data) {
$("#child-listview-" + Id).kendoListView({
template: $("#child-template").html(),
dataSource: data.ChildItems
})
}
注意我有一個名爲標識一個簡單的整型屬性上我的數據對象,但如果你需要或別的東西,你可以使用該行的UID。
相關問題
- 1. Kendo Ui嵌套JSON解析
- 2. Kendo ui數據源刷新?
- 3. Kendo UI數據源限制
- 4. 查詢Kendo UI數據源
- 5. kendo ui中的多個數據源dropdownlistfor?
- 6. Kendo UI遠程數據源修改
- 7. kendo ui數據源過濾器「in」
- 8. Kendo UI數據源和陣列
- 9. 無法設置Kendo UI Grid數據源
- 10. Kendo UI TreeList - 數據源綁定問題
- 11. Kendo UI treeview當前數據源文章
- 12. Kendo UI Grid數據源和REST API
- 13. Kendo UI Grid,排序數據源組
- 14. Kendo UI Treeview和XML數據源
- 15. Kendo網格數據源嵌套和組合過濾器
- 16. 如何在數據源中爲listview設置數據項kendo ui
- 17. 嵌套Tablix數據源
- 18. Kendo UI數據源傳輸讀取忽略數據參數
- 19. 在Kendo UI Grid的數據源中加載圖像
- 20. Kendo UI樹視圖中的層級數據源
- 21. Kendo UI網格不會從ajax數據填充數據源MVC
- 22. Kendo UI Grid未從數據源加載數據
- 23. Kendo UI Web調度程序 - 動態修改資源數據源
- 24. 訪問嵌套轉發的數據源
- 25. Kendo AutoComplete的新數據源
- 26. 數據源不會在kendo ui自動完成中刷新
- 27. Kendo UI Sceduler,數據綁定
- 28. Kendo UI BarChart數據分組
- 29. 如何將新的kendo數據源綁定到現有的kendo-web-UI listview?
- 30. 如何刪除kendo ui列表視圖數據源中的所有數據項