{"title":"dataview","inframe":false,"hidden":false,"roles":{"demo":1,"dev":1},"pageLink":"","children":[{"configs":{"itemId":"module"},"children":[{"configs":{"layout":"border","itemId":"viewport1"},"children":[{"configs":{"region":"north","itemId":"toolbar1"},"children":[{"configs":{"text":"添加","itemId":"newBtn","iconCls":"record_add_icon"},"events":{"click":"app.store.add({\n  name: '消息聊天',\n  icon: 'message'\n})[0].commit();\n//建议使用Wb.add(app.dataview1,{name: '消息聊天',icon: 'message'});"},"children":[],"type":"item","expanded":false},{"configs":{"text":"修改","itemId":"editBtn","iconCls":"record_edit_icon"},"events":{"click":"var rec = app.store.getAt(0);\nrec.set('name', '修改的项');\nrec.commit();\n//建议使用Wb.update(rec,{name:'修改的项'});\nWb.toast('第一项已经被修改');"},"children":[],"type":"item","expanded":false},{"configs":{"text":"删除","itemId":"delBtn","iconCls":"record_delete_icon"},"events":{"click":"var recs = app.dataview1.getSelection();\nif (recs.length)\n  app.store.remove(recs);\nelse Wb.toast('请选择至少一项。');\n//建议使用Wb.remove(app.dataview1);"},"children":[],"type":"item","expanded":false},{"configs":{"text":"-","itemId":"item1"},"children":[],"type":"item","expanded":false},{"configs":{"text":"选择项","itemId":"getBtn","iconCls":"message_icon","tooltip":"提取选择项的信息"},"events":{"click":"var recs = app.dataview1.getSelection(),\n  names = [];\nWb.info('你选择了：' + Wb.pluck(recs, 'name').join(','));"},"children":[],"type":"item","expanded":false}],"type":"toolbar","expanded":true},{"configs":{"itemSelector":"div.wb_item","region":"center","multiSelect":"true","autoScroll":"true","style":"background:white;","selectedItemCls":"wb_selected","tpl":"<tpl for='.'>\n<div class='wb_item' style='width:80px;text-align:center;'>\n<img src='wb/images/icon/{icon}.png'>\n<p>{name}<\/p>\n<\/div>\n<\/tpl>","dragSelector":"true","itemId":"dataview1","overItemCls":"wb_hover"},"children":[{"configs":{"data":"[{\n  name: '数据库管理',\n  icon: 'db'\n}, {\n  name: '文件管理器',\n  icon: 'explorer'\n}, {\n  name: '我的消息',\n  icon: 'message'\n}, {\n  name: '音乐播放器',\n  icon: 'play'\n}, {\n  name: '应用设置',\n  icon: 'set'\n}, {\n  name: '方案配置',\n  icon: 'theme'\n}, {\n  name: '用户管理',\n  icon: 'user'\n}, {\n  name: '网络浏览器',\n  icon: 'web'\n}]","itemId":"store","fields":"['name', 'icon']"},"children":[],"type":"store","expanded":false}],"type":"dataview","expanded":true}],"type":"viewport","expanded":true}],"type":"module","expanded":true}],"iconCls":""}