{"hidden":false,"children":[{"configs":{"itemId":"module"},"expanded":true,"children":[{"configs":{"layout":"fit","itemId":"win","focusControl":"true","editWin":"true"},"expanded":true,"children":[{"configs":{"layout":"absolute","itemId":"form1","flat":"true","width":"456","height":"328"},"expanded":true,"children":[{"configs":{"itemId":"FIELD_NAME","labelAlign":"right","fieldLabel":"字段标签","x":"16","width":"416","y":"16","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"layout":"hbox","itemId":"fileFieldContainer","labelAlign":"right","fieldLabel":"二进制字段","width":"416","x":"16","y":"56","height":"22"},"expanded":true,"children":[{"configs":{"itemId":"FILE_FIELD","flex":"1"},"expanded":false,"children":[],"type":"file"},{"configs":{"itemId":"delFileBtn","margin":"0 1 0 3","text":"删除"},"expanded":false,"children":[],"type":"button","events":{"click":"Wb.removeFile(button.previousNode());"}}],"type":"fieldcontainer"}],"type":"form"}],"type":"window","events":{"ok":"var params, values = Wb.getValue(win);\nif (app.isEdit) {\n  //点击修改按钮的处理过程\n  params = Wb.applyIf(values, Wb.getData(app.selRec, true));\n  //清除params中的文件项参数值，以使用实际文件控件上传的二进制流值\n  Wb.clearFileItem(params, win);\n  Wb.upload({\n    url: '{#updateUrl#}',\n    form: app.form1,\n    params: params,\n    success: function(form, action, value) {\n      Wb.update(app.selRec, Wb.applyIf(Wb.decode(value), values));\n      app.win.close();\n    }\n  });\n} else {\n  //点击添加按钮的处理过程\n  Wb.upload({\n    url: '{#insertUrl#}',\n    form: app.form1,\n    success: function(form, action, value) {\n      Wb.add(app.grid1, Wb.applyIf(Wb.decode(value), values));\n      app.win.close();\n    }\n  });\n}"}},{"configs":{"layout":"border","itemId":"viewport1"},"expanded":true,"children":[{"configs":{"itemId":"mainBar","region":"north"},"expanded":true,"children":[{"configs":{"itemId":"newBtn","tooltip":"添加新的记录 (Ctrl+E)","text":"添加","iconCls":"record_add_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"app.win.show();\napp.win.setTitle('添加');\napp.win.setIconCls('record_add_icon');\napp.isEdit = false;"}},{"configs":{"itemId":"editBtn","tooltip":"修改选择的记录","text":"修改","iconCls":"record_edit_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"var sels = app.grid1.getSelection();\nif (sels.length != 1) {\n  Wb.warn('请选择 1 条需要修改的记录。');\n  return;\n}\napp.selRec = sels[0];\napp.win.show();\napp.win.setTitle('修改');\napp.win.setIconCls('record_edit_icon');\nWb.setValue(app.win, app.selRec.data);\napp.isEdit = true;"}},{"configs":{"itemId":"delBtn","tooltip":"删除选择的记录","text":"删除","iconCls":"record_delete_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"var sels = app.grid1.getSelection();\nif (!sels.length) {\n  Wb.warn('请选择需要删除的记录。');\n  return;\n}\nWb.confirm('确定要删除选择的 ' + sels.length + ' 条记录吗？', function() {\n  Wb.request({\n    url: '{#deleteUrl#}',\n    params: {\n      destroy: Wb.getData(sels, true)\n    },\n    success: function() {\n      Wb.remove(app.grid1, sels);\n    }\n  });\n});"}},{"configs":{"itemId":"line1","text":"-"},"expanded":false,"children":[],"type":"item"},{"configs":{"itemId":"searchCombo","tpl":"<table cellspacing='0' width='100%'>\n  <tpl for='.'>\n    <tr class='x-boundlist-item'>\n      <td width='50px'>\n        {{#codeField#}}\n      <\/td>\n      <td>\n        {{#nameField#}}\n      <\/td>\n    <\/tr>\n  <\/tpl>\n<\/table>","onTriggerClick":"this.collapse();\napp.mainStore.load({\n  out: app.mainBar\n});","emptyText":"编号或名称","triggerCls":"x-form-search-trigger","width":"180","displayField":"{#searchKeyField#}","enterKeyTriggerClick":"true"},"expanded":true,"children":[{"configs":{"itemId":"store","normalName":"searchStore","url":"{#searchUrl#}"},"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.mainStore.load();"}}],"type":"toolbar"},{"configs":{"itemId":"grid1","region":"center","multiSelect":"true"},"expanded":true,"children":[{"configs":{"itemId":"store","normalName":"mainStore","autoLoad":"true","url":"{#selectUrl#}"},"expanded":false,"children":[],"type":"store"}],"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":"//公共方法和属性定义\nWb.apply(app, {\n\n});"}}],"roles":{"demo":1},"title":"{#title#}","iconCls":"{#iconCls#}","inframe":false,"pageLink":""}