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