{
	"hidden": false,
	"children": [{
		"configs": {
			"itemId": "module"
		},
		"expanded": true,
		"children": [

		 {
			"configs": {
				"layout": "fit",
				"itemId": "viewport1"
			},
			"expanded": true,
			"children": [{
				"configs": {
					"itemId": "grid1",
					"multiSelect": "true"
				},
				"expanded": true,
				"children": [{
					"configs": {
						"itemId": "store",
						"autoLoad": "true",
						"url": "#{table_store_url}"
					},
					"expanded": false,
					"children": [],
					"type": "store"
				}, {
					"configs": {
						"itemId": "tbar"
					},
					"expanded": true,
					"children": [
					 {
                             "configs": {
                              "itemId": "querytext",
                              "labelAlign": "right",
                              "fieldLabel": "名称",
                              "labelWidth": "60"
                             },
                             "expanded": false,
                             "children": [],
                             "type": "text"
                            },
                            {
                             "configs": {
                              "itemId": "querybtn",
                              "text": "查询",
                              "iconCls": "search_icon"
                             },
                             "expanded": false,
                             "children": [],
                             "type": "item",
                             "events": {"click": "app.grid1.store.load({out: app.tbar});"}
                            },
                            {
                             "configs": {
                              "itemId": "splitbar",
                              "text": "-"
                             },
                             "expanded": false,
                             "children": [],
                             "type": "item"
                            },
					     {
						"configs": {
							"itemId": "newBtn",
							"tooltip": "添加新的记录",
							"text": "添加",
							"iconCls": "record_add_icon"
						},
						"expanded": false,
						"children": [],
						"type": "item",
						"events": {"click": "var win = new Ext.window.Window(app._win); //app._win指向配置对象而非实例\n win.show();\n win.setIconCls('record_add_icon');\n Wb.setTitle(win, '添加');\n //窗口每次动态生成,方法在窗口销毁时自动销毁\n  win.mon(win, 'ok', function() {\n var values = Wb.getValue(win);\n Wb.requestAg({\n params: {\n #{controller}: values,\n bean: \"#{controller}bean\",\n method: \"saveMethod\" //业务方法名 \n  },\n success: function(resp) {\n win.close();\n app.querybtn.fireEvent('click');\n    Wb.tip('保存成功');\n   }\n }); \n });"}
					}, {
						"configs": {
							"itemId": "editBtn",
							"tooltip": "修改选择的记录",
							"text": "修改",
							"iconCls": "record_edit_icon"
						},
						"expanded": false,
						"children": [],
						"type": "item",
						"events": {
							"click": "var rec = app.grid1.getSelection()[0];\nif (!rec) {\n  Wb.warn('请选择 1 条需要修改的记录。');\n  return;\n}\n var win = new Ext.window.Window(app._win); //app._win指向配置对象而非实例\nwin.show();\nwin.setIconCls('record_edit_icon');\n Wb.setTitle(win, '修改');\nWb.setValue(win, rec.data); //把记录数据应用到窗口\n//窗口每次动态生成,方法在窗口销毁时自动销毁\nwin.mon(win, 'ok', function() {\n  var values = Wb.applyIf(Wb.getValue(win), Wb.getData(rec, true)); //Wb.getData用于获取记录中的原始值，见Wb.getData方法\n  Wb.requestAg({\n   params: {#{controller}: values, bean: \"#{controller}bean\", method: \"updateMethod\"  },\n    success: function(resp) {\n      Wb.update(rec, values); //同步在客户端表格中更新\n      win.close();\n    }\n  });\n});"
						}
					}, {
						"configs": {
							"itemId": "delBtn",
							"tooltip": "删除选择的记录",
							"text": "删除",
							"iconCls": "record_delete_icon"
						},
						"expanded": false,
						"children": [],
						"type": "item",
						"events":{"click":"var rec=app.grid1.getSelection()[0]; \n  Wb.confirm('确定要删除这条记录吗？', \n function(){Wb.requestAg({params:{ID:rec.data.ID,bean:\"#{controller}bean\",method:\"delsingleMethod\"}, \n success:function(resp){Wb.remove(app.grid1);Wb.tip('删除成功');}});});"}
					}],
					"type": "toolbar"
				}
				],
				"type": "grid",
				"events": {
					"itemdblclick": "app.editBtn.fireEvent('click');"
				}
			}],
			"type": "viewport"
		}],
		"type": "module"
	}],
	"roles": {
		"demo": 1
	},
	"title": "基本对话框编辑",
	"iconCls": "",
	"inframe": false,
	"pageLink": ""
}