[CLOSED] Select Row in Buffered Grid

  1. #1

    [CLOSED] Select Row in Buffered Grid

    Hello

    I am using buffered grids and I understand that they do not load all the rows at one time so using something like this does not work:
    App.myGrid.getSelectionModel().select(record, false);
    On this example page
    https://examples2.ext.net/#/GridPane...red_Scrolling/

    there is a "GO" feature that allows a user to enter a row number, press Go and the UI is supposed to scroll to that row, however, it does not work. The "go" javascript function fails with the error "verticalScroller.scrollTo" is undefined.

    Is there a way to move to a row in a buffered grid given an index? Basically, what would it take to make the go feature on that example page work?

    I also tried adding an "ext:GridPagingScroller" to my gird but was not able to make it work.

    Thank you for your help.

    P
    Last edited by Baidaly; Feb 09, 2013 at 8:11 AM. Reason: [CLOSED]
  2. #2
    Hi Patrick,

    Thank you for the report. Strange, there is no such a method in ExtJS 4.1.1 (Ext.NET v2.1 uses it).

    Please clarify what Ext.NET sources do you use? If trunk, then use:
    grid.getView().bufferedRenderer.scrollTo(100, true);
  3. #3
    Hello Danil

    As always, thank you for your quick response, it means a lot to me and my company.

    Unfortunately after making sure that we are using the latest 2.1.1.18233 Ext.Net.dll it still does not work. There is no bufferedRenderer of the getView() object. When we do a NuGet we are getting version 2.1.0.0 of the Ext.Net.Utilities.dll. Would the bufferedRender changes have been in the utilities class but maybe they didnt make it into NuGet.

    These are all the methods I have tried with no success:
    App.myGrid.view.onRowSelect(idx)
    App.myGrid.view.onRowFocus(idx, highlight, suppressFocus)
    App.myGrid.view.focusRow(idx)
    App.myGrid.getView().focusRow(idx)
    App.myGrid.getView().container.scrollTo(idx)
    I would try these methods, but I am not sure what to pass in for item:
    App.myGrid.getView().setHighlightedItem(item)
    App.myGrid.getView().highlightItem(item)
    These methods come "close" to what we need but we really need to be able to select via an index
    App.myGrid.selModel.selectNext(keepExisting, suppressEvent)
    App.myGrid.selModel.selectPrevious(keepExisting, suppressEvent)
    Is there anyway the buffered renderer example on the example page can be updated to 2.1.1 and javascript function updated to what would allow selection via an index?

    Thank you again

    Patrick
  4. #4
    Hello!

    Try the following:

    <script>
    	var go = function () {
    		var me = this,
    			field = me.up('toolbar').down('#gotoLine'); 
    		
    		if (field.isValid()) { 
    			var v = me.up('grid').verticalScroller;
    			v.view.el.scrollTo('top', (field.getValue() - 1) * v.rowHeight, false);
    		}
    	};
    </script>
    We are investigating example issue.

    Thank you!
  5. #5
    Quote Originally Posted by Daniil View Post
    If trunk, then use:
    grid.getView().bufferedRenderer.scrollTo(100, true);
    So, a bufferedRenderer is available in the Ext.NET sources from the SVN trunk.
  6. #6
    You guys are too cool!! It worked.

    I didnt catch that I should pull the code from your source control, I was looking in the contents of the NuGet package. There is a little more I have to do ... when I build the Ext.Net solution and copy over all the dlls various things dont work. However, when I reference the Ext.Net solution and clean up the references, things work better... I will try to sort this out.

    You can close this ticket.

    Thank you again for being rock stars!!
  7. #7
    Thank you for the excellent feedback!:)

    Yes, cleaning up a solution helps with such issues.

Similar Threads

  1. [CLOSED] Buffered Grid Scrolling repeats rows
    By jwhitmire36 in forum 2.x Legacy Premium Help
    Replies: 10
    Last Post: Feb 09, 2013, 5:49 AM
  2. [CLOSED] Infinite srolling buffered grid scrolling problem
    By ASAPCH in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 04, 2013, 3:55 AM
  3. [CLOSED] Buffered Grid with filtering and editing
    By jchau in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 13, 2013, 6:39 AM
  4. [CLOSED] Shared store with buffered grid
    By Justin_Wignall in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 05, 2012, 2:00 PM
  5. [CLOSED] Buffered Grid View Scrolling
    By bethc in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 02, 2009, 7:29 AM

Tags for this Thread

Posting Permissions