Results 1 to 3 of 3

Thread: How to force the selected row in the grid to scroll to the center

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
      0  

    Default How to force the selected row in the grid to scroll to the center

    I want to make the row in the center of gird. I try code like this:
    Code:
    myGridView.ensureVisible(rowIndex, 0, true);
    or
    Code:
    myGridView.focusRow(rowIndex);
    It just makes the row visible, sometimes the row is on the bottom of the grid.
    Is there any method to make the row in the center of the gird.
    I know that ,we should call scroller.setScrollTop() function, but I don't know the value to set.

  2. #2
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default

    I wrote some code to do this in ExtJS 4.x. I'm not sure if it will help you or not.

    http://www.sencha.com/forum/showthre...)-selected-row

  3. #3
    Sencha User
    Join Date
    Sep 2014
    Posts
    12
    Vote Rating
    -2
      0  

    Default

    First use the following code
    .centered-text {
    text-align:center
    }


    And then use it
    <div class="row">
    <div class="span12 centered-text">
    <h1>Bootstrap starter template</h1>
    <p>Use this document as a way to quick start any new project.<br> All you get is this message and a barebones HTML document.</p>
    </div>
    </div>

Posting Permissions

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