Again about the last pos.of the grid( bottom - Ctrl+End)

I asked this question in earlier :

viewtopic.php?f=2&t=24879&p=78960&hilit=go+bottom#p78960

Sorry , but I can’t to do like in advice . Can you help to me ? How to extract the last position and let to grid to go ?

Also I found that ( key press Ctrl + End ) :
mygrid.selectCell( mygrid.rowsCol[ mygrid.rowsCol.length - 1 ], mygrid._cCount-1, false, false, true );
mygrid._select_ifpossible();

But can’t understand how to let to grid activate this ? In which “attachEvent” ?

With best reagrds ! Many thanks in advance !

How to extract the last position and let to grid to go ?

F.e. you have a grid with 1000 rows, 10 rows are visible in the grid at once.
So the index of the last row is 999. 991 - ix the index of the first row in case scrolling the grid to the end.
You need to load xml with the following parameters:






Excuse , but I can’t understand this place … Sorry for that … I have javascript code :

     var mygrid = tabbar.cells( tabbar.getActiveTab() ).attachGrid();
      mygrid.setImagePath( "codebase/imgs/" );

      mygrid.setColumnIds( slc_fld )
      mygrid.setHeader( grd_set[ 1 ] );
      mygrid.attachHeader( grd_set[ 2 ] );
      mygrid.setColTypes( grd_set[ 3 ] );
      mygrid.setColSorting( grd_set[ 4 ] );
      mygrid.setInitWidths( grd_set[ 5 ] )
      mygrid.setColAlign( grd_set[ 6 ] )
      mygrid.setColumnsVisibility( grd_set[ 7 ] );
      mygrid.setNumberFormat( "00000", kiek_col );
      mygrid.setDateFormat( "%Y.%m.%d" );

      mygrid.enableSmartRendering( true, 100 );
      mygrid.init();
      mygrid.load( cQry );
     // and etc.. 

xml is returning through - var cQry = “uzs1.php?fld=” + slc_fld + “&d_b=” + $app_db; . And now I must to direct to xml position … How ? Can you post a simple sample ?

Excuse , but I’m new in javascript . Working with others techniques - xBase or MSB Dinamic Axapta - grid object have a method gobottom() . Simply after form load I can direct to do event and let grid go bottom . Something similar I imagined and here . Exist Ctrl+End - it let to grid to go bottom . After some search I found , that in dhtmlxgrid_keymap_excel.js for Ctrl+End keypress exist this :

k35_1_0:function(){ //ctrl-end
if (this.editor || !this.rowsCol.length) return false;
this.selectCell(this.rowsCol[this.rowsCol.length-1],this._cCount-1,true);
}

The problem - how to activate this code for one time , then grid is loaded and let to go bottom ? :slight_smile:

With best reagrds !

Hello, Rimokas.
I apologize.
There is a simple solution for your issue:

mygrid.objBox.scrollTop = mygrid.objBox.scrollHeight;