{
	"hidden": false,
	"children": [{
		"configs": {
			"itemId": "module"
		},
		"expanded": true,
		"children": [{
			"configs": {
				"layout": "absolute",
				"dialog": "true",
				"itemId": "win",
				"createInstance": "false",
				"focusControl": "STRING_FIELD",
				"closeAction": "destroy",
				"width": "664",
				"title": "增删改查",
				"modal": "true",
				"height": "352"
			},
			"expanded": true,
			"children": [{
				"configs": {
					"allowBlank": "false",
					"itemId": "STRING_FIELD",
					"labelAlign": "right",
					"fieldLabel": "* 字符串",
					"width": "312",
					"x": "8",
					"y": "16",
					"labelWidth": "90",
					"height": "22"
				},
				"expanded": false,
				"children": [],
				"type": "text"
			}, {
				"configs": {
					"itemId": "INT_FIELD",
					"labelAlign": "right",
					"fieldLabel": "整数",
					"width": "312",
					"x": "328",
					"y": "16",
					"labelWidth": "90",
					"height": "22"
				},
				"expanded": false,
				"children": [],
				"type": "number"
			}, {
				"configs": {
					"itemId": "DOUBLE_FIELD",
					"labelAlign": "right",
					"fieldLabel": "浮点数",
					"width": "312",
					"x": "8",
					"y": "48",
					"labelWidth": "90",
					"height": "22"
				},
				"expanded": false,
				"children": [],
				"type": "number"
			}, {
				"configs": {
					"itemId": "DATETIME_FIELD",
					"labelAlign": "right",
					"fieldLabel": "日期时间",
					"width": "312",
					"x": "328",
					"y": "48",
					"labelWidth": "90",
					"height": "22"
				},
				"expanded": false,
				"children": [],
				"type": "datetime"
			}, {
				"configs": {
					"itemId": "BOOL_FIELD",
					"labelAlign": "right",
					"fieldLabel": "布尔字段",
					"keyName": "bool",
					"width": "312",
					"x": "8",
					"y": "80",
					"labelWidth": "90",
					"height": "22"
				},
				"expanded": false,
				"children": [],
				"type": "combo"
			}, {
				"configs": {
					"itemId": "CLOB_FIELD",
					"labelAlign": "right",
					"fieldLabel": "大文本字段",
					"width": "632",
					"x": "8",
					"y": "120",
					"labelWidth": "90",
					"height": "162"
				},
				"expanded": false,
				"children": [],
				"type": "textarea"
			}],
			"type": "window"
		}, {
			"configs": {
				"layout": "fit",
				"itemId": "viewport1"
			},
			"expanded": true,
			"children": [{
				"configs": {
					"itemId": "grid1",
					"multiSelect": "true"
				},
				"expanded": true,
				"children": [{
					"configs": {
						"itemId": "store",
						"autoLoad": "true",
						"url": "m?xwl=examples/crud/crud-db-access/basic-select"
					},
					"expanded": false,
					"children": [],
					"type": "store"
				}, {
					"configs": {
						"itemId": "tbar"
					},
					"expanded": true,
					"children": [{
						"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指向配置对象而非实例\nwin.show();\nwin.setIconCls('record_add_icon');\nWb.setTitle(win, '添加');\n//窗口每次动态生成,方法在窗口销毁时自动销毁\nwin.mon(win, 'ok', function() {\n  var values = Wb.getValue(win);\n  Wb.request({\n    url: 'm?xwl=examples/crud/crud-db-access/basic-insert', //使用basic-insert用于演示基本的操作，更简单的操作可使用'm?xwl=examples/crud/crud-db-access/insert'替代\n    params: values,\n    success: function(resp) {\n      Wb.apply(values, Wb.decode(resp.responseText)); //把后台返回的ID_FIELD等数据应用到values中\n      Wb.add(app.grid1, values); //同步在客户端表格中添加\n      win.close();\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}\nvar win = new Ext.window.Window(app._win); //app._win指向配置对象而非实例\nwin.show();\nwin.setIconCls('record_edit_icon');\nWb.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.request({\n    url: 'm?xwl=examples/crud/crud-db-access/update',\n    params: values,\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": "/*\n建议使用此方法：\nWb.del(app.grid1, {\n  url: 'm?xwl=examples/crud/crud-db-access/delete',\n  titleField: 'STRING_FIELD'\n});\n*/\n//使用下面方法用于演示完整的步骤\nvar recs = app.grid1.getSelection();\nif (!recs.length) {\n  Wb.warn('请选择需要删除的记录。');\n  return;\n}\nWb.confirm('确定要删除选择的 ' + recs.length + ' 条记录吗？', function() {\n  Wb.request({\n    url: 'm?xwl=examples/crud/crud-db-access/basic-delete', //使用basic-delete.xwl用于演示目的，建议使用delete.xwl\n    params: {\n      destroy: Wb.getData(recs, true)\n    },\n    success: function() {\n      Wb.remove(app.grid1, recs);\n    }\n  });\n});"
						}
					}],
					"type": "toolbar"
				}, {
					"configs": {
						"itemId": "columns"
					},
					"expanded": true,
					"children": [{
						"configs": {
							"itemId": "rowNumCol",
							"xtype": "rownumberer"
						},
						"expanded": false,
						"children": [],
						"type": "column"
					}, {
						"configs": {
							"itemId": "stringCol",
							"dataIndex": "STRING_FIELD",
							"width": "150",
							"text": "字符串字段"
						},
						"expanded": true,
						"children": [],
						"type": "column"
					}, {
						"configs": {
							"itemId": "numCols",
							"text": "数字列"
						},
						"expanded": true,
						"children": [{
							"configs": {
								"itemId": "intCol",
								"dataIndex": "INT_FIELD",
								"text": "整数字段",
								"align": "right",
								"titleAlign": "left"
							},
							"expanded": true,
							"children": [],
							"type": "column"
						}, {
							"configs": {
								"itemId": "doubleCol",
								"dataIndex": "DOUBLE_FIELD",
								"text": "浮点数字段",
								"align": "right",
								"titleAlign": "left"
							},
							"expanded": true,
							"children": [],
							"type": "column"
						}],
						"type": "column"
					}, {
						"configs": {
							"itemId": "boolCol",
							"dataIndex": "BOOL_FIELD",
							"keyName": "bool",
							"text": "布尔字段"
						},
						"expanded": true,
						"children": [],
						"type": "column",
						"events": {
							"afterrender": "return Wb.kv();"
						}
					}, {
						"configs": {
							"itemId": "datetimeCol",
							"dataIndex": "DATETIME_FIELD",
							"width": "170",
							"text": "日期时间字段"
						},
						"expanded": true,
						"children": [],
						"type": "column"
					}, {
						"configs": {
							"itemId": "clobCol",
							"dataIndex": "CLOB_FIELD",
							"flex": "1",
							"text": "大文本字段",
							"autoWrap": "true"
						},
						"expanded": true,
						"children": [],
						"type": "column"
					}],
					"type": "array"
				}],
				"type": "grid",
				"events": {
					"itemdblclick": "app.editBtn.fireEvent('click');"
				}
			}],
			"type": "viewport"
		}],
		"type": "module"
	}],
	"roles": {
		"demo": 1
	},
	"title": "基本对话框编辑",
	"iconCls": "",
	"inframe": false,
	"pageLink": ""
}