Results 1 to 6 of 6

Thread: Error scrolling to specific record in buffered grid

  1. #1

    Default Answered: Error scrolling to specific record in buffered grid

    Hi!

    I have a (buffered) grid with lots of entries and I want to scroll to a unrendered record programmatically. I tried a lot of options to achieve this, but without success.
    Among others, I tried the following method calls:
    • grid.bufferedRenderer.scrollTo
    • grid.ensureVisible
    • grid.getView().focusRow
    • grid.getView().scrollRowIntoView


    The most promising approach are grid.bufferedRenderer.scrollTo and grid.ensureVisible.

    But I get errors when calling these methods (errors are thrown in BufferedRenderer):

    grid.ensureVisible(record/index) / grid.bufferedRenderer.scrollTo(record/index):
    Code:
    Uncaught TypeError: Cannot read property 'getHeight' of null
        at constructor.getScrollHeight (BufferedRenderer.js?_dc=1558685337419:1990)
        at constructor.refreshSize (BufferedRenderer.js?_dc=1558685337419:441)
        at constructor.afterTableLayout (BufferedRenderer.js?_dc=1558685337419:384)
        at constructor.finishedLayout (TableLayout.js?_dc=1558685337420:352)
        at constructor.callLayout (Context.js?_dc=1558685337417:371)
        at constructor.flushLayouts (Context.js?_dc=1558685337417:559)
        at constructor.runComplete (Context.js?_dc=1558685337417:1236)
        at constructor.callOverrideParent (Ext.js?_dc=1558685337417:59)
        at constructor.callParent (Base.js?_dc=1558685337417:1470)
        at constructor.runComplete (Component.js?_dc=1558685337417:223)
    The error is the same for both calls. I tried the calls using several parameters (record, index, recordId).

    Does anyone have an idea what the problem could be? I am using ExtJs 6.7.0

  2. Hello Simon,

    Please see the below fiddle which should help with the requirement.

    https://fiddle.sencha.com/#view/editor&fiddle/2t8c

    Regards,
    Kumar
    Sencha Support.

  3. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Thank you so much for your post. I apologize for the delay. I have shared this with the support staff and someone will get back to provide assistance as soon as possible. Your patience is greatly appreciated!

    Kind Regards,

    Michele


  4. #3
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    533
    Answers
    7

    Default

    Hello Simon,

    Thank you for contacting Sencha support!

    The following should help fix the issue,

    Use delay it will work, also find the fiddle below for your reference.


    Please try with scrollTo() and setScrollY();

    https://fiddle.sencha.com/#view/editor&fiddle/2slh


    Regards,
    Kumar
    Sencha Support.

  5. #4

    Default

    Hi,

    thanks for your answer.

    Scrolling in the grid that way would work, though, I want to scroll to a specific (unrendered) record.
    The methods scrollTo() and setScrollY() are scrolling to a Y coordinate and not to a record.

    How can I scroll to a specific record in the grid without getting the error I mentioned in the first post of this thread?
    Or is it possible to request the Y coordinate of a certain (unrendered) record anyhow in order to use scrollTo() or setScrollY() to scroll to the Y position of that record?

    Regards,
    Simon

  6. #5
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    533
    Answers
    7

    Default

    Hello Simon,

    Please see the below fiddle which should help with the requirement.

    https://fiddle.sencha.com/#view/editor&fiddle/2t8c

    Regards,
    Kumar
    Sencha Support.

  7. #6

    Default

    Hi rakumar,

    thank you, that solves my problem!

    Best regards,
    Simon

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •