View Full Version : Can I get the column index of a grid inside keys property when using multirow select?

20 Feb 2012, 5:53 AM
This is what I used so far:

keys: [{
key: [Ext.EventObject.F2],
handler: function() {
var gridrecord = grid.getSelectionModel().getSelected();
var rowIndex = grid.getStore().indexOf(gridrecord);
var cm = grid.getColumnModel();

//var colIndex = cm.findColumnIndex(editEvent.field);

//var columns = grid.getView().cm.config;
//var cs = grid.getView().getColumnData();
//var cell = grid.getView().getCell(rowIndex, col);
//var row = grid.getStore().getAt(rowIndex);
//var artistId = column.dataIndex;

//var colIndex = cm.getIndexById(); //grid.Column cm.config['1'].id
//var colIndex = cm.getIndexById()
//var view = grid.getView();
//var colIndex = view.findCellIndex(el);

//var selectionModel = grid.getSelectionModel();
//var selectedRecords = selectionModel.getSelection();
//var myValue = selectedRecords[0].get('fieldName');

grid.startEditing(rowIndex, 1);

20 Feb 2012, 6:32 AM
You can get the index from the findColumnIndex method on the column model passing in the dataIndex

20 Feb 2012, 6:45 AM
I am using a keymap and multirowselection model and I want to start editing the grid when I press a key based on a selected rowindex and colindex...because is a row selection grid I can get the row index but note the column index ...is it possible to capture a specific column index based on a click on it in the grid using this selection model?