PDA

View Full Version : pb selection on html tr on grid



crealivres
13 Jun 2010, 2:05 PM
is there a param or something to make the 2nd tr element, (the 1st is column and works well) which is html, on grid selectionable by click?

The trackMouseOver works on both but selection can only on columns.

Thank you for help

Condor
13 Jun 2010, 10:20 PM
See the Grid FAQ (http://www.extjs.com/learn/Ext_FAQ_Grid#How_to_select_text_in_the_grid_.28with_the_mouse.29_so_that_it_can_be_copied_to_the_clipboard).

crealivres
14 Jun 2010, 6:03 AM
i cannot find any useful help in this forum.

the only event that fire is containerclick.
i tried this code:

Ext.override(Ext.grid.GridView, {
onRowOver : function(e, t){
var row;
if((row = this.findRowIndex(t)) !== false){
this.addRowClass(row, 'x-grid3-row-over');
RowOverIdx = row;
}
},
onRowOut : function(e, t){
var row;
if((row = this.findRowIndex(t)) !== false && !e.within(this.getRow(row), true)){
this.removeRowClass(row, 'x-grid3-row-over');
RowOverIdx = 0;
}
}
});

var grid = new Ext.grid.GridPanel({
...


listeners: {
...
containerclick : function( t, e ) {
if (RowOverIdx != 0) t.getSelectionModel().selectRow(RowOverIdx);
}
...
})

it is working but not perfectly.
And it is not clean. RowOverIdx parent is Ext.