{"title":"常规请求","inframe":false,"hidden":false,"roles":{"demo":1,"dev":1},"pageLink":"","children":[{"configs":{"itemId":"module"},"children":[{"configs":{"itemId":"store1","url":"m?xwl=examples/basic/data-submit/common-requests/store-data"},"events":{"beforeload":"operation.params = {\n  foo: 123,\n  bar: 'abc'\n};"},"children":[],"type":"store","expanded":false},{"configs":{"itemId":"treestore1","url":"m?xwl=examples/basic/data-submit/common-requests/tree-store-data"},"children":[],"type":"treestore","expanded":false},{"configs":{"height":"248","width":"480","layout":"absolute","itemId":"panel1"},"children":[{"configs":{"text":"Ajax请求","height":"22","width":"120","itemId":"ajaxBtn","y":"16","x":"16"},"events":{"click":"//按Ctrl+4插入Wb.request模板\nWb.request({\n  url: 'm?xwl=examples/basic/data-submit/common-requests/resp-ajax', //url路径，Ctrl+双击文件插入url，在配置项编辑器中可拖动文件或按Ctrl+拖动文件（多选）添加url\n  params: { //用户指定参数，可选\n    str: 'bar',\n    num: 123,\n    object: {\n      item: 'value'\n    },\n    array: [1, 2, 'abc'],\n    date: new Date()\n  },\n  //showMask: false,请求过程不显示mask\n  //message: '正在请求数据...',\n  //mask: app.panel1, mask遮盖对象，默认为全屏，前1.5秒透明遮盖。\n  out: app.panel1, //输出panel1下所有控件值，可选。指定控件或控件列表，输出该控件及所有子控件值，另如：out:[app.text1,app.date1]\n  success: function(resp) {\n    Cs.log(Wb.decode(resp.responseText)); //Cs.info/log/warn/error等都可使用，如果浏览器不支持等于执行空函数。\n    Wb.info('返回数据：' + resp.responseText);\n  }\n});\n//out参数名称如果同params参数名称重名，params指定参数优先级高"},"children":[],"type":"button","expanded":false},{"configs":{"text":"Store Load","height":"22","width":"120","itemId":"storeLoadBtn","y":"56","x":"16"},"events":{"click":"app.store1.params = {\n  base1: 'baseParam'\n}; //store.params参数在每次请求时都有效，除非手动清除。但优先级最低。\napp.store1.load({\n  out: app.panel1,\n  params: {\n    foo: 'bar',\n    abc: 123\n  }, //把panel1下所有控件值和用户指定参数合并作为参数\n  //showMask: false,请求过程不显示mask\n  //message: '正在请求数据...',\n  //showError: false,屏蔽自动显示的错误信息\n  mask: app.panel1, //mask遮盖对象，未指定默认为全屏，前1.5秒透明遮盖。\n  callback: function(records, operation, success) { //回调函数，success表明成功加载\n    if (success)\n      Wb.info('Store成功加载完成。');\n  }\n}); //store中的参数在下一次store.load时将被覆盖\n//在store的beforeload事件operation.params={foo:'bar'}也可设置参数"},"children":[],"type":"button","expanded":false},{"configs":{"text":"Store Reload","height":"22","width":"120","itemId":"storeReloadBtn","y":"56","x":"152"},"events":{"click":"//重新加载store\n//store.reload和store.loadPage方法一样会自自动传递最后一次调用的所有参数（包括回调方法），store.load方法则不会(但store.param仍然传递）\napp.store1.reload({\n  callback: null //如果最后一次调用指定有回调函数，使用reload后仍将触发该回调函数，如果指定新的参数将覆盖原回调函数\n});\n//如果在store.reload方法中指定params参数，原参数会被覆盖，如果需要叠加参数可使用Wb.reload(store,{params:{},callback:fn});\n//BufferedStore的参数传递请使用store.params"},"children":[],"type":"button","expanded":false},{"configs":{"text":"TreeStore Load","height":"22","width":"120","itemId":"treeStoreLoadBtn","y":"96","x":"16"},"events":{"click":"//Tree通常在节点展开时自动加载，指定Tree的root属性或设置rootVisible为false即可\n//使用以下代码可重新加载指定节点\n//app.treestore1.load({\n//  node: node\n//});"},"children":[],"type":"button","expanded":false},{"configs":{"text":"TreeStore Reload","height":"22","width":"120","itemId":"treeStoreReloadBtn","y":"96","x":"152"},"events":{"click":"app.treestore1.reload(); //重新加载最后一个加载的节点"},"children":[],"type":"button","expanded":false},{"configs":{"text":"Wb.reload Tree","height":"22","width":"120","itemId":"wbReloadTreeBtn","y":"96","x":"280"},"events":{"click":"//Wb.reload(tree); //重新加载根节点，并默认根据显示属性(text)刷新当前路径，具体见Wb.reload方法说明。"},"children":[],"type":"button","expanded":false},{"configs":{"text":"常规Sumit","height":"22","width":"120","itemId":"commonSubmit","y":"136","x":"16"},"events":{"click":"Wb.submit('ide', {\n  p1: 'foo',\n  p2: 123,\n  p3: new Date()\n}); //向目标发起submit请求，目标默认为_blank，详见：Wb.submit方法说明。"},"children":[],"type":"button","expanded":false},{"configs":{"text":"控件参数：","cls":"wb_line","height":"22","width":"440","itemId":"label1","y":"176","x":"16"},"children":[],"type":"label","expanded":false},{"configs":{"labelWidth":"60","height":"22","width":"200","value":"text1","labelAlign":"right","itemId":"text1","fieldLabel":"字符串","y":"208","x":"24"},"children":[],"type":"text","expanded":false},{"configs":{"labelWidth":"60","height":"22","width":"200","value":"@new Date()","labelAlign":"right","itemId":"date1","fieldLabel":"日期","y":"208","x":"248"},"children":[],"type":"date","expanded":false}],"type":"panel","expanded":true}],"type":"module","expanded":true}],"iconCls":""}