Results 1 to 3 of 3

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

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    45

    Default Can I get the column index of a grid inside keys property when using multirow select?

    This is what I used so far:

    keys: [{
    key: [Ext.EventObject.F2],
    handler: function() {
    //specialkeyfunction();
    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
    //getColumnId
    //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);
    }
    }]

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    You can get the index from the findColumnIndex method on the column model passing in the dataIndex
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    45

    Default I have a multirowselection model

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •