{"inframe":false,"title":"字典自定义编辑","hidden":false,"roles":{"demo":1,"dev":1},"children":[{"configs":{"description":"文件上传模式窗口下必须放itemId为form的formPanel控件，非上传模式无需此控件。\n如果窗口为实例默认为单例模式，如果窗口为对象(createInstance为false)默认为非单例模式。","itemId":"module"},"children":[{"configs":{"title":"标题在Wb.edit函数configs参数中配置","height":"376","layout":"fit","width":"664","defaultFocus":"STRING_FIELD","itemId":"win","dialog":"true","modal":"true","createInstance":"false"},"events":{"hide":"//单例模式(win属性createInstance不是false)下使用 Wb.reset(win);","show":"if (win.isNew) {\n  win.setTitle('添加');\n  win.setIconCls('record_add_icon');\n  app.delFileBtn.hide();\n} else {\n  win.setTitle('修改');\n  Wb.setTitle(win, win.editData.STRING_FIELD);\n  win.setIconCls('record_edit_icon');\n}","ok":"win.editHandler(); //Wb.edit调用后默认提供的方法"},"children":[{"configs":{"height":"320","flat":"true","layout":"absolute","width":"664","itemId":"form","border":"false"},"children":[{"configs":{"labelWidth":"90","height":"22","allowBlank":"false","width":"312","labelAlign":"right","itemId":"STRING_FIELD","fieldLabel":"* 字符串","y":"16","x":"8"},"children":[],"expanded":false,"type":"text"},{"configs":{"labelWidth":"90","height":"22","width":"312","labelAlign":"right","itemId":"INT_FIELD","fieldLabel":"整数","y":"16","x":"328"},"children":[],"expanded":false,"type":"number"},{"configs":{"labelWidth":"90","height":"22","width":"312","labelAlign":"right","itemId":"DOUBLE_FIELD","fieldLabel":"浮点数","y":"48","x":"8"},"children":[],"expanded":false,"type":"number"},{"configs":{"labelWidth":"90","height":"22","width":"312","labelAlign":"right","itemId":"DATETIME_FIELD","fieldLabel":"日期时间","y":"48","x":"328"},"children":[],"expanded":false,"type":"datetime"},{"configs":{"tagConfigs":"{\n  //重载控件的getValue/setValue方法\n  getValue: function() {\n    var vals = Wb.getValue(this, ['radio1', 'radio2']);\n    if (vals.radio1)\n      return 0;\n    else if (vals.radio2)\n      return 1;\n    else return null;\n  },\n  setValue: function(v) {\n    Wb.setValue(this, {\n      radio1: v === 0,\n      radio2: v == 1\n    });\n  }\n}","labelWidth":"90","height":"30","width":"312","layout":"hbox","labelAlign":"right","itemId":"BOOL_FIELD","fieldLabel":"布尔","y":"80","x":"8"},"children":[{"configs":{"name":"boolField","itemId":"radio1","boxLabel":"允许","flex":"1"},"children":[],"expanded":false,"type":"radio"},{"configs":{"name":"boolField","itemId":"radio2","boxLabel":"拒绝","flex":"1"},"children":[],"expanded":false,"type":"radio"}],"expanded":true,"type":"fieldcontainer"},{"configs":{"labelWidth":"90","height":"30","width":"312","layout":"hbox","labelAlign":"right","itemId":"fieldcontainer1","fieldLabel":"二进制","y":"80","x":"328"},"children":[{"configs":{"itemId":"BLOB_FIELD","flex":"1"},"children":[],"expanded":false,"type":"file"},{"configs":{"text":"删除","margin":"0 0 0 3","itemId":"delFileBtn"},"events":{"click":"app.BLOB_FIELD.reset();\napp.BLOB_FIELD.removeFile = true; //标识需删除，后台据此判断当上传文件为空时是否执行删除"},"children":[],"expanded":false,"type":"button"}],"expanded":true,"type":"fieldcontainer"},{"configs":{"height":"190","width":"632","labelAlign":"right","itemId":"CLOB_FIELD","y":"120","x":"8"},"children":[],"expanded":false,"type":"htmleditor"}],"expanded":true,"type":"form"}],"expanded":true,"type":"window"},{"configs":{"layout":"fit","itemId":"viewport1"},"children":[{"configs":{"tagConfigs":"{\n  //如果表格存在此方法，二进制字段自动生成下载链接并指向此方法，如果存在多个二进制字段可通过ifDownloadBlob方法控制哪个字段提供下载\n  downloadBlob: function(fieldName, rowIndex) {\n    var grid = this;\n    //在文件列表中按ctrl+双击文件名可添加url地址\n    Wb.download('m?xwl=examples/crud/crud-db-access/download-blob', {\n      ID_FIELD: grid.store.getAt(rowIndex).data.ID_FIELD\n    });\n  }\n}","multiSelect":"true","itemId":"grid1"},"events":{"itemdblclick":"app.editBtn.fireEvent('click');"},"children":[{"configs":{"autoLoad":"true","itemId":"store","url":"m?xwl=examples/crud/crud-db-access/select"},"children":[],"expanded":false,"type":"store"},{"configs":{"itemId":"tbar"},"children":[{"configs":{"text":"添加","itemId":"newBtn","iconCls":"record_add_icon","tooltip":"添加新的记录"},"events":{"click":"Wb.insert(app.grid1, {\n  win: app._win, //app.win指向实例，app._win指向对象\n  url: 'm?xwl=examples/crud/crud-db-access/insert'\n});"},"children":[],"expanded":false,"type":"item"},{"configs":{"text":"修改","itemId":"editBtn","iconCls":"record_edit_icon","tooltip":"修改选择的记录"},"events":{"click":"Wb.edit(app.grid1, {\n  win: app._win,\n  url: 'm?xwl=examples/crud/crud-db-access/update'\n});"},"children":[],"expanded":false,"type":"item"},{"configs":{"text":"删除","itemId":"delBtn","iconCls":"record_delete_icon","tooltip":"删除选择的记录"},"events":{"click":"Wb.del(app.grid1, {\n  url: 'm?xwl=examples/crud/crud-db-access/delete',\n  titleField: 'STRING_FIELD'\n});"},"children":[],"expanded":false,"type":"item"}],"expanded":true,"type":"toolbar"}],"expanded":true,"type":"grid"}],"expanded":true,"type":"viewport"}],"expanded":true,"type":"module"}],"pageLink":"","iconCls":""}