2013년 10월 17일 목요일

Working with context menus

invoicesGrid.on({
itemcontextmenu: function(grid, record, item, index, e, eOpts)
{
e.stopEvent();
var viewBtn = contextMenu.items.get(0);
var editBtn = contextMenu.items.get(1);
var resendBtn = contextMenu.items.get(2);
var archiveBtn = contextMenu.items.get(3);
var deleteBtn = contextMenu.items.get(4);
var status = record.get('Status');
switch (status) {
case 'Paid':
viewBtn.enable();
editBtn.disable();
resendBtn.disable();
archiveBtn.enable();
deleteBtn.disable();
break;
case 'Sent':
viewBtn.enable();
editBtn.enable();
resendBtn.enable();
archiveBtn.disable();
deleteBtn.enable();
break;
case 'Viewed':
viewBtn.enable();
editBtn.enable();
resendBtn.enable();
archiveBtn.disable();
deleteBtn.enable();
break;
default:
}
contextMenu.showAt(e.getXY());
}
});

댓글 없음:

댓글 쓰기