Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. $("#ddlTest_I").kendoComboBox({
  2. dataTextField: "parentName",
  3. dataValueField: "parentId",
  4. dataSource: [
  5. { parentName: "Parent1", parentId: 1, childName: "Child1", childId: 1 },
  6. { parentName: "Parent2", parentId: 2, childName: "Child2", childId: 2 },
  7. { parentName: "Parent1", parentId: 1, childName: "Child3", childId: 3 },
  8. { parentName: "Parent2", parentId: 2, childName: "Child4", childId: 4 },
  9. { parentName: "Parent1", parentId: 1, childName: "Child5", childId: 5 }
  10. ]
  11. });
  12.  
  13. $("#ddlTest_II").kendoComboBox({
  14. cascadeFrom: "ddlTest_I",
  15. dataTextField: "childName",
  16. dataValueField: "childId",
  17. dataSource: [
  18. {parentName: "Parent1", parentId: 1, childName: "Child1", childId: 1 },
  19. { parentName: "Parent2", parentId: 2, childName: "Child2", childId: 2 },
  20. { parentName: "Parent1", parentId: 1, childName: "Child3", childId: 3 },
  21. { parentName: "Parent2", parentId: 2, childName: "Child4", childId: 4 },
  22. { parentName: "Parent1", parentId: 1, childName: "Child5", childId: 5 }
  23. ]
  24. });
  25.  
  26. var comboDataSource = new kendo.data.DataSource(parentDatasource.data()); // pseudo
  27. comboDataSource.add(parentDatasource.data()[0]); // might need add item by item
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement