Web/ExtJS 2013. 7. 19. 18:05

// to capture ALL events use:

Ext.util.Observable.fireEvent = Ext.Function.createInterceptor(function() {

        console.log(this.name);

        console.log(arguments);

        return true;

});


// to capture events for a particular component:

Ext.util.Observable.capture(

Ext.getCmp('id-1212'),    // <= 여기에 찾고자 하는 컴포넌트를 넣어준다.

function(e) {

console.info(e);

}

);

'Web > ExtJS' 카테고리의 다른 글

grid row 선택시 페이지 위로 스크롤되는 버그 수정  (0) 2013.04.29
posted by hani^___^
:
Web/ExtJS 2013. 4. 29. 14:34

ExtJS 4.1.3 기준..


원인은 Ext.selection.*Model 에서 onRowMouseDown함수의 view.el.focus(); 가 문제의 원인임.

따라서 Ext.selection.*Model 의 onRowMouseDown을 override 하여 view.el.focus(); 라인을 주석처리하여 수정.

다른 model 도 소스를 복사하여 아래의 부분만 수정해주면 됨.


Ext.application({

...


launch: function() {

// fix bug for being moved to top on gridview click

Ext.override(Ext.selection.CheckboxModel, {

onRowMouseDown: function(view, record, item, index, e) {

        //view.el.focus();

        var me = this,

           checker = e.getTarget('.' + Ext.baseCSSPrefix + 'grid-row-checker'),

           mode;

           

       if (!me.allowRightMouseSelection(e)) {

           return;

       }

       // checkOnly set, but we didn't click on a checker.

       if (me.checkOnly && !checker) {

           return;

       }

       if (checker) {

           mode = me.getSelectionMode();

           // dont change the mode if its single otherwise

           // we would get multiple selection

           if (mode !== 'SINGLE') {

               me.setSelectionMode('SIMPLE');

           }

           me.selectWithEvent(record, e);

           me.setSelectionMode(mode);

       } else {

           me.selectWithEvent(record, e);

       }

   }

});


...


Ext.create('Ext.container.Viewport', {


});

});

'Web > ExtJS' 카테고리의 다른 글

특정 component의 모든 event 보기 (ExtJS 4기준)  (0) 2013.07.19
posted by hani^___^
: