Archive for September, 2009

How to use ExtJS Abstract functions

Posted on the September 22nd, 2009 under ExtJS by

For some methods in ExtJS, you will see:

Class Ext.grid.GridDragZone

onDrag( Event e ) : void

Abstract method called during the onMouseMove event while dragging an object.

Parameters:

e : Event

the mousemove event

Returns:Class Ext.grid.GridDragZone

void

In this case, GridDragZone is part of GridView which is part of GridPanel. Accessing it will be, GridPanel->GridView->GridDragZone.

The GridDragZone gets implemented for a GridPanel when you set enableDragDrop to true, but it only becomes available when the grid renders, so:

var grid = new Ext.grid.GridPanel({
    // etc
});
grid.on('render', function(obj) {
    obj.getView().dragZone.onDrag=function(evt){
        alert('being dragged');
    }
});