{"hidden":false,"children":[{"configs":{"itemId":"module"},"expanded":true,"children":[{"configs":{"layout":"border","itemId":"viewport1"},"expanded":true,"children":[{"configs":{"layout":"absolute","itemId":"panel1","width":"512","region":"north","height":"80"},"expanded":true,"children":[{"configs":{"itemId":"label1","width":"328","x":"16","y":"8","text":"请在面板或表格点击右键，系统将显示弹出式菜单。","height":"22"},"expanded":false,"children":[],"type":"label"},{"configs":{"itemId":"text1","width":"344","x":"16","y":"40","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"itemId":"button1","width":"88","x":"368","y":"40","text":"按钮","height":"22"},"expanded":false,"children":[],"type":"button"},{"configs":{"isConfig":"true","itemId":"popupMenu","normalName":"menu1","width":"80","x":"368","y":"8","height":"22"},"expanded":true,"children":[{"configs":{"itemId":"newBtn","text":"添加","iconCls":"record_add_icon"},"expanded":false,"children":[],"type":"item"},{"configs":{"itemId":"editBtn","text":"修改","iconCls":"record_edit_icon"},"expanded":false,"children":[],"type":"item"},{"configs":{"itemId":"delBtn","text":"删除","iconCls":"record_delete_icon"},"expanded":false,"children":[],"type":"item"}],"type":"menu"}],"type":"panel"},{"configs":{"itemId":"grid1","region":"center","multiSelect":"true"},"expanded":true,"children":[{"configs":{"groupField":"TITLE","itemId":"store","autoLoad":"true","url":"m?xwl=examples/controls/grid/data-source/select-employee"},"expanded":false,"children":[],"type":"store"},{"configs":{"itemId":"columns"},"expanded":true,"children":[{"configs":{"itemId":"realNameCol","renderer":"var sex = record.get('SEX');\nreturn Wb.getIcon(record.get('SEX') == '2' ? 'user1_icon' : 'user_icon', sex) + value;","dataIndex":"REAL_NAME","width":"150","text":"姓名"},"expanded":false,"children":[],"type":"column"},{"configs":{"itemId":"birthDateCol","dataIndex":"BIRTH_DATE","text":"生日"},"expanded":false,"children":[],"type":"column"},{"configs":{"itemId":"sexCol","lockable":"false","dataIndex":"SEX","keyName":"sex","width":"50","text":"性别","align":"center","titleAlign":"left"},"expanded":false,"children":[],"type":"column"},{"configs":{"itemId":"vacationHoursCol","dataIndex":"VACATION_HOURS","width":"110","format":"#,##0","text":"休假时长","align":"right"},"expanded":false,"children":[],"type":"column"}],"type":"array"},{"configs":{"itemId":"popupMenu","normalName":"menu2"},"expanded":true,"children":[{"configs":{"itemId":"popupComp","text":"当前对象信息","iconCls":"object_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"Wb.info(app.menu2.popupComp.itemId); //同一menu可以用于多个控件，popupComp指向使菜单弹出的控件"}},{"configs":{"itemId":"popupRow","text":"当前行信息","iconCls":"record_icon"},"expanded":false,"children":[],"type":"item","events":{"click":"var rowData = app.menu2.selectRow.data; //selectRow在popupMenu的show事件中设置\nWb.info('选择：' + rowData.REAL_NAME);"}}],"type":"menu","events":{"show":"var rows = app.grid1.getSelection();\napp.popupRow.setDisabled(rows.length != 1);\nmenu.selectRow = rows[0];"}}],"type":"grid"}],"type":"viewport"}],"type":"module"}],"roles":{"demo":1},"title":"弹出式菜单","iconCls":"","inframe":false,"pageLink":""}