0
votes

today I am facing a problem with shift+click functionality problem in extjs 4.I want to do same functionality as it is in gmail. On clicking checkbox with shift+click row should get selected.I have grid panel with checkbox - selModel. And I want to add this functionality on clicking on checkbox only not on cellclick. I have checked mode and multiSelect config from checkboxModel and grid panel, but they are working for row selection only not on checkbox selection.Thanks in advance.

1

1 Answers

2
votes

Finally, Working solution with ext js 4.2

Ext.define('MyApp.override.CheckboxModelOverrides', {
override: 'Ext.selection.CheckboxModel', 

 onRowMouseDown : function(view, record, item, index, e) {
    var me = this;

    if (index !== -1) {

        if (!me.allowRightMouseSelection(e)) {
            return;
        }

        if (e.shiftKey && me.lastFocused) {
            me.selectRange(me.lastFocused, record, e.ctrlKey);
            me.processSelection(view, record, item, index, e);
        }

        if (!me.isSelected(record)) {
            me.mousedownAction = true;
            me.processSelection(view, record, item, index, e);
        } else {
            me.mousedownAction = false;
        }
    }

  }   
});