Results 1 to 2 of 2

Thread: Change selection only on specific column

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    33
    Vote Rating
    0
      0  

    Default Change selection only on specific column

    Lets say we have a grid panel with column A and column B. What i want to do is the selection to be changed only when the user selects the part of the row that is under column A. Is this possible ?

  2. #2
    Sencha User Arg0n's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    122
    Answers
    12
    Vote Rating
    16
      0  

    Default

    It is:

    Code:
    getTargetFromEvent: function(event) {
            var me = this,
                view = me.view;
    
    
            var cell = event.getTarget(view.cellSelector);
    
    
            if (this.targetCell !== cell) {
                view.fireEvent('cellchange', this.targetCell, cell, event);
                this.targetCell = cell;
            }
    
    
            if (cell) {
    
    
                var row = view.findItemByChild(cell),
                    columnIndex = cell.cellIndex;
    
    
                if (row && Ext.isDefined(columnIndex)) {
    
    
                    return {
                        node: cell,
                        record: view.getRecord(row),
                        fieldName: me.columns[columnIndex].dataIndex
                    };
                }
            }
        },

Posting Permissions

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