{"hidden":false,"children":[{"configs":{"itemId":"module"},"expanded":true,"children":[{"configs":{"layout":"border","itemId":"viewport1"},"expanded":true,"children":[{"configs":{"itemId":"toolbar1","region":"north"},"expanded":true,"children":[{"configs":{"itemId":"newBtn","tooltip":"添加新的记录 (Ctrl+E)","text":"添加","iconCls":"record_add_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"if (!app.selDept) {\n  Wb.warn('部门未选择。');\n  return;\n}\nWb.insert(app.grid1, {\n  url: 'm?xwl=examples/employee/dialog/insert',\n  params: {\n    DEPT_ID: app.selDept.data.DEPT_ID\n  }\n});"}},{"configs":{"itemId":"editBtn","tooltip":"修改选择的记录","text":"修改","iconCls":"record_edit_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"Wb.edit(app.grid1, {\n  url: 'm?xwl=examples/employee/dialog/update',\n  titleField: 'REAL_NAME'\n});"}},{"configs":{"itemId":"delBtn","tooltip":"删除选择的记录","text":"删除","iconCls":"record_delete_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"Wb.del(app.grid1, {\n  url: 'm?xwl=examples/employee/dialog/delete',\n  titleField: 'REAL_NAME'\n});"}},{"configs":{"itemId":"item1","text":"-"},"expanded":false,"children":[],"type":"item"},{"configs":{"itemId":"searchCombo","onTriggerClick":"this.collapse();\napp.grid1.store.load({\n  out: app.toolbar1 //toolbar1内的所有控件值作为参数列表\n});","emptyText":"姓名","triggerCls":"x-form-search-trigger","width":"130","displayField":"REAL_NAME","enterKeyTriggerClick":"true"},"expanded":true,"children":[{"configs":{"itemId":"store","url":"m?xwl=examples/employee/edit/search"},"expanded":false,"children":[],"type":"store"}],"type":"combo","events":{"select":"Ext.callback(combo.onTriggerClick, combo);"}},{"configs":{"itemId":"resetSearchBtn","tooltip":"重置搜索结果","text":"重置搜索","iconCls":"undo_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"app.loadData();"}}],"type":"toolbar"},{"configs":{"itemId":"deptTree","file":"m?xwl=examples/employee/public/dept-tree"},"expanded":false,"children":[],"type":"xwl"},{"configs":{"itemId":"grid1","viewConfig":"{\n  plugins: {\n    ptype: 'gridviewdragdrop',\n    ddGroup: 'dept',\n    enableDrop: false\n  }\n}","region":"center","multiSelect":"true"},"expanded":true,"children":[{"configs":{"itemId":"store","remoteSort":"true","sorters":"'EMPLOYEE_CODE'","url":"m?xwl=examples/employee/dict-edit/select"},"expanded":false,"children":[],"type":"store","events":{"load":"if (!app.grid1.columnConfiged) {\n  Wb.getColumn(store, 'COMPANY_NAME').editor = app.grid1.COMPANY_NAME;\n  app.grid1.columnConfiged = true;\n}"}},{"configs":{"itemId":"COMPANY_NAME","bindField":"COMPANY_ID","displayField":"COMPANY_NAME","listConfig":"{\n  minWidth: 200\n}"},"expanded":true,"children":[{"configs":{"itemId":"store","url":"m?xwl=examples/employee/edit/company-list"},"expanded":false,"children":[],"type":"store"}],"type":"combo"}],"type":"grid","events":{"itemdblclick":"app.editBtn.fireEvent('click');"}}],"type":"viewport","events":{"afterrender":"app.navKey = new Ext.KeyNav({\n  viewport: app.viewport1,\n  E: {\n    ctrl: true,\n    fn: function() {\n      app.newBtn.fireEvent('click');\n    }\n  }\n});"}}],"type":"module","events":{"initialize":"Wb.apply(app, {\n  /**\n   * tree1配置拖放事件，允许grid数据拖动到tree以调整人员所属部门。\n   */\n  treeViewConfig: {\n    plugins: {\n      ptype: 'treeviewdragdrop',\n      ddGroup: 'dept',\n      enableDrag: false\n    },\n    listeners: {\n      beforedrop: function(node, data, om, dp, dh) {\n        dh.wait = true;\n        dh.cancelDrop();\n        Wb.request({\n          url: 'm?xwl=examples/employee/edit/change-dept',\n          params: {\n            newDeptId: om.data.DEPT_ID,\n            recs: Wb.getData(data.records)\n          },\n          success: function() {\n            Wb.remove(app.grid1);\n          }\n        });\n      },\n      nodedragover: function(node, dp, data) {\n        return dp == 'append' && app.selectDeptNode != node;\n      }\n    }\n  },\n  /**\n   * 加载指定部门的人员数据。\n   */\n  loadData: function() {\n    if (app.selDept)\n      app.grid1.store.load({\n        params: app.selDept.data\n      });\n  }\n});"}}],"roles":{"demo":1},"title":"字典对话框","iconCls":"","inframe":false,"pageLink":""}