PDA

View Full Version : right click get data



quintino
9 Apr 2010, 6:59 AM
Welcome all,
I have another problem width a grid (i've ever problem width them XD),
when i click width the right key on a record of the grid, i open a menuto decide if modify o delete that record.
And this is ok. My problem is : how can i catch the data from the row grid??

this is my code


var grid = new Ext.grid.GridPanel({
title : 'Elenco Pratiche',
id : 'grid_users',
autoFill : true,
stripeRows: true,
stateful: true,
autoscroll:true,
autoSizeColumns: true,
autoExpandColumn: 'utente_as',
width : Ext.lib.Dom.getViewportWidth() - 60,
height: Ext.lib.Dom.getViewportHeight() - 185,
store : this.store_users,
colModel : colModel,
selModel : selModel,
viewConfig: {
forceFit:true,
enableRowBody:true,
showPreview:true,
},
listeners : {
rowcontextmenu : function(thisGrid, rowIndex, evtObj) {
evtObj.stopEvent();
this.selModel.selectRow(rowIndex);
GridUsersMenu.showAt(evtObj.getXY());
//alert('sono a destra');
},
},
// paging bar on the bottom
bbar: {
xtype : 'paging',
//id : 'StandardGridPagingToolbar',
store: store_users,
pageSize : 25,
displayInfo : true
},

loadMask: { msg: 'Caricamento dati in corso...', store: store_users }
});


and this is the code of menu


var GridUsersMenu = new Ext.menu.Menu ({
id : 'StandardGridContextMenu',
items : [
{ text : 'Modifica',
iconCls : 'icon-pencil',
handler : modifica
}
,{ text : 'Cancella',
iconCls : 'icon-delete',
//handler : StandardGridDelete
}
]
});

function modifica(clickedItem, record){
console.log(clickedItem);
}


thank you all for the support and sorry for my english :D