{"title":"树和表格联动","inframe":false,"hidden":false,"roles":{"demo":1,"dev":1},"pageLink":"","children":[{"configs":{"itemId":"module"},"children":[{"configs":{"layout":"border","itemId":"viewport1"},"children":[{"configs":{"rootVisible":"false","region":"west","title":"树表格","tools":"Wb.getTreeTools()","width":"300","split":"true","itemId":"tree1"},"events":{"selectionchange":"//此示例仅演示查询所在本部门人员列表（不含子部门），如需查询子部门人员可以在SQL中使用递归查询功能，具体请参阅指定数据库SQL递归查询文档。\nvar node = selected[0];\nif (!node) return;\napp.employeeStore.load({\n  params: {\n    DEPT_ID: node.data.DEPT_ID\n  }\n});"},"children":[{"configs":{"itemId":"store","url":"m?xwl=examples/controls/tree/data-source/tree-select"},"events":{"success":"//仅在首次加载时选择首个节点\nWb.selFirst(app.tree1);","beforeload":"var node = operation.node;\noperation.params.parentDept = node.isRoot() ? -1 : operation.node.data.DEPT_ID;"},"children":[],"type":"treestore","expanded":false}],"type":"tree","expanded":true},{"configs":{"region":"center","itemId":"grid1"},"children":[{"configs":{"itemId":"store","normalName":"employeeStore","url":"m?xwl=examples/controls/tree/data-source/select-employee"},"children":[],"type":"store","expanded":false},{"configs":{"itemId":"columns"},"children":[{"configs":{"xtype":"rownumberer","itemId":"numCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"名","width":"150","dataIndex":"FIRST_NAME","itemId":"firstNameCol","renderer":"var sex = record.get('SEX');\nreturn Wb.getIcon(record.get('SEX') == 'M' ? 'user_icon' : 'user1_icon', sex) + value;"},"children":[],"type":"column","expanded":false},{"configs":{"text":"姓","dataIndex":"LAST_NAME","itemId":"lastNameCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"生日","dataIndex":"BIRTH_DATE","itemId":"birthDateCol"},"children":[],"type":"column","expanded":false},{"configs":{"text":"性别","align":"center","width":"50","dataIndex":"SEX","titleAlign":"left","itemId":"sexCol"},"children":[],"type":"column","expanded":false}],"type":"array","expanded":true}],"type":"grid","expanded":true}],"type":"viewport","expanded":true}],"type":"module","expanded":true}],"iconCls":""}