2

I am currently using the grid component with Extjs 4.1 based on the editable grid example. I would like to have a link associated with each cell so that when I click on a cell it takes me popup box to insert data. However, when there is a vertical scroll that is triggered on the page when clicking on the link. It is going to first line of the grid. This only happens in IE (I am using version 8). But it is working fine in chrome. Plz help me to fix issue for IE 8.

My code is:

var myGrid = {
    title:'Station',
    xtype:'dynamicgrid',
    forceFit:true,
    columnLines: true,
    selType: 'cellmodel',
    plugins: [cellEditing], 
    region:'center',
    autoHeight:true,
    autoWidth: 2100,
    store:myStore,
    features: [{
       ftype: 'grouping'
    }],
    dockedItems: [{
       store: myStore,
       dock: 'bottom',
       displayInfo: true
    }],
    listeners: {
        cellclick: function(iView, iCellEl, iColIdx, iRecord, iRowEl, iRowIdx, iEvent) {
               var fieldName = iView.getGridColumns()[iColIdx].dataIndex;
               var val = iRecord.get(fieldName);
               var a = val.split("<br>");
               if(a[0]==="NA"){
                  opennewwindow1(val);
               } else {
                  opennewwindow2(val);
               };
          }
     }    
 };
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
  • possible duplicate of [How to prevent extjs grid from scrolling when clicking on a cell?](http://stackoverflow.com/questions/6061392/how-to-prevent-extjs-grid-from-scrolling-when-clicking-on-a-cell) – bummi Jul 20 '15 at 06:10

1 Answers1

0

try to select the Row in the Click event

cellclick: function(iView, iCellEl, iColIdx, iRecord, iRowEl, iRowIdx, iEvent) {
iView.getStore().getSelectionModel().select(iRowIdx);
.
.
.
}
foued611
  • 359
  • 2
  • 7