Results 1 to 2 of 2

Thread: GXT Grid vertical scrollbar not appearing

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    17

    Default GXT Grid vertical scrollbar not appearing

    I am using GXT grid (height is set as 350px) in GWT DisclosurePanel. DisclosurePanel will be in closed state when I add the grid into it.


    When the user clicks DisclosurePanel header, the panel opens up and shows up the GXT Grid. All working as expected except that the GXT grid does not display the vertical scroll bar when there are lot of items in the grid.


    I tried to setup Grid height on DiclosurePanel onOpen() event to forcefully trigger the scrollbar, but looks like my below DOM manipulation code does not add the style into "<div class="GP34Q33EGC-com-sencha-gxt-theme-gray-client-grid-GrayGridAppearance-GrayGridStyle-scroller"></div>"


    Code:
    grid.getView().getBody().getParentElement().getStyle().setHeight(350, Unit.PX);
    I'm not very sure I explained the problem well here, due to some restriction, I am not able to post all code here. Please advise me if the problem makes sense to you.

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    Quote Originally Posted by saravvij View Post
    I am using GXT grid (height is set as 350px) in GWT DisclosurePanel. DisclosurePanel will be in closed state when I add the grid into it.


    When the user clicks DisclosurePanel header, the panel opens up and shows up the GXT Grid. All working as expected except that the GXT grid does not display the vertical scroll bar when there are lot of items in the grid.
    I guess the grid didn't run doLayout() on setHeight, since it wasn't displayed at that time. When it showed up, it may not have been informed properly.
    Quote Originally Posted by saravvij View Post
    I tried to setup Grid height on DiclosurePanel onOpen() event to forcefully trigger the scrollbar, but looks like my below DOM manipulation code does not add the style into "<div class="GP34Q33EGC-com-sencha-gxt-theme-gray-client-grid-GrayGridAppearance-GrayGridStyle-scroller"></div>"


    Code:
    grid.getView().getBody().getParentElement().getStyle().setHeight(350, Unit.PX);
    Ehhr, manipulating at Elements Style is probably a bad idea. I suggest you call grid.setHeight right after construction.
    Then when panel opens up and grid is shown you may call grid.forceLayout();

    Quote Originally Posted by saravvij View Post
    I'm not very sure I explained the problem well here, due to some restriction, I am not able to post all code here. Please advise me if the problem makes sense to you.
    I feel your pain. Writing a quick, short example with a grid involved is always difficult: You need store, properties, columns and some data. Easiest way might be to alter one of the Sencha examples.

Similar Threads

  1. Replies: 9
    Last Post: 27 Jul 2015, 7:56 AM
  2. Replies: 0
    Last Post: 2 Aug 2011, 4:56 PM

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
  •