[CLOSED] GridPanel Item Collection seems to work - except grid height is not calculated correctly

  1. #1

    [CLOSED] GridPanel Item Collection seems to work - except grid height is not calculated correctly

    Hi,

    I just realized today that you can add components into the Items collection of the GridPanel.

    For example I added the following to the GridPanel itself in your FitLayout example:
    https://examples1.ext.net/#/GridPanel/Layout/FitLayout/

    <Items>
        <ext:Panel Height="75" Title="Hello" Html="Messages" />
    </Items>
    To my pleasant surprise it worked - I saw this panel just above the grid.

    However, the scrolling/height calculation doesn't seem quite right in this situation.

    If you run the FitLayout example with the above added to it, the window loads fine, but you don't see all 10 rows (you see about 7) and the scrollbar doesn't appear. If you then resize the window to make it a bit smaller you will eventually see the scrollbar for the grid, but the bottom part is cut off.

    I've attached a screenshot/diagram if that helps?

    I suspect the grid scrollbar height calculation doesn't account for any other Items in the Items collection?

    I was looking at the Ext JS documentation for grid panel and could not see an Items collection - I did see a note saying the following:

    "Although this class inherits many configuration options from base classes, some of them (such as autoScroll, autoWidth, layout, items, etc) are not used by this class, and will have no effect." -- http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.GridPanel

    So I wonder, is this a feature you have provided, or is it just the way your class hierarchy works and Sencha recommend you do not use Items for a Grid but do not actively override it in their class?

    Otherwise it would be quite useful for this to work. Of course, the alternative is I can create a composite component to achieve the same affect.
    Attached Thumbnails Click image for larger version. 

Name:	GridWithPanelInItemsCollection.png 
Views:	78 
Size:	34.1 KB 
ID:	4380  
    Last edited by Daniil; Jun 19, 2012 at 1:59 PM. Reason: [CLOSED]
  2. #2
    Hi Anup,

    Quote Originally Posted by anup View Post
    "Although this class inherits many configuration options from base classes, some of them (such as autoScroll, autoWidth, layout, items, etc) are not used by this class, and will have no effect." -- http://docs.sencha.com/ext-js/3-4/#!/api/Ext.grid.GridPanel
    That is true for Ext.NET as well.

    Quote Originally Posted by anup View Post
    So I wonder, is this a feature you have provided, or is it just the way your class hierarchy works and Sencha recommend you do not use Items for a Grid but do not actively override it in their class?
    Correct, it is just due to the class hierarchy. We can't lower the accessibility modifier for the Items property.

    We could add an exception to be thrown if a developer used Items for GridPanel. But there are so many such cases in ExtJS/Ext.NET, that the framework will swell if we would add such exceptions for all cases.

    Though we will keep it in mind.
    Last edited by Daniil; Jun 19, 2012 at 1:58 PM.
  3. #3
    I understand - thought I'd double check, as it almost solved a problem for me in such a way that I could avoid a lot of refactoring :) But it does make sense to be fair. I am happy for you to mark this as closed.

Similar Threads

  1. [CLOSED] ext:GridPanel: Calculated page size
    By supera in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2012, 4:13 PM
  2. Replies: 7
    Last Post: Oct 14, 2011, 9:59 AM
  3. [CLOSED] Height of DIV element is not adjusting correctly
    By ISI in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: May 19, 2011, 3:19 PM
  4. Replies: 2
    Last Post: Jan 17, 2011, 3:02 PM
  5. [CLOSED] [1.0] Button in CompositeField not in Item collection
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 28, 2010, 3:18 PM

Posting Permissions