Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8454813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:07:31+00:00 2026-06-10T12:07:31+00:00

i found 2 similar questions here, but they are not helped me, my code

  • 0

i found 2 similar questions here, but they are not helped me, my code is:

var grid = Ext.create('Ext.grid.Panel', {
    autoScroll: true,
    // if set this to any numeric value, then everything works just good, but 
    // i was hoping that `ExtJS` already can detect browser window height, am i wrong ?
    height: '100%', 
    title: 'Products',
    store: store,
    itemId: 'product_grid',
    columns: [.. columns skipped ...],
    plugins: [ rowEditing ],
    dockedItems: [ ..addRow button here..]
});
var panel = Ext.create('Ext.panel.Panel', {
    autoScroll: true,
    items: [
    {
        xtype: 'productGrid'
    }
    ]
});
Ext.create('Ext.container.Viewport', {
    layout: 'fit',
    items: panel
});

What i need i scrollable grid filling whole browser window, but grid here does not expand
in height, so if grid has 0 rows, then it has 0 height and when i push “Add row”, then
added row looks obscured by scrollbars and this looks ugly.

Also when grid contain more rows than could fit in browser window, then page scrollbar appears (not grid’s scrollbar!) and this scrolls whole page so button bar scrolled away, which is also undesirable and ugly.

Any ideas what is wrong with my setup.

UPDATE:

Finally fixed it, intermediate panel should also contain layout: ‘fit’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:07:32+00:00Added an answer on June 10, 2026 at 12:07 pm

    There’s a couple things you can do here. First, use the fit layout on your Viewport as it will force its child component to fill the available space. Second, grids are panels. You don’t need to nest a grid in a panel, and probably shouldn’t.

    The autoScroll config doesn’t work on grids. Scrolling in both directions is enabled by default, but if you need to change it use the scroll property. Lastly, the height config only takes a number and doesn’t work with strings or percentages. If you specify a height, it overrides any height given by the layout manager and you don’t need it for fit layouts.

    var grid = Ext.create('Ext.grid.Panel', {
        title:       'Products',
        store:       store,
        itemId:      'product_grid',
        columns:     [/* ... */],
        plugins:     [rowEditing],
        dockedItems: [/* ... */]
    });
    
    var viewport = Ext.create('Ext.container.Viewport', {
        layout: 'fit',
        items:  [grid]
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw some other similar questions on this topic here but they were not
I've looked at similar questions here but I haven't found one particular to my
I found a few questions similar to this one here on SO, but none
There are a few questions on here that are similar, but they didn't work
I've looked through similar questions but not found the exact working solution I'm after.
I know there are already some similar questions here. But I do not want
I can't resolve this issue, I found a similar question here but: setting the
I found this similar question here , but this is really old. Was it
I've found a similar question here , but I'm looking for more general solutions.
I'm sure this is asked plenty and i've found some questions on here similar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.