Results 1 to 8 of 8

Thread: [SOLVED]Gridpanel + height + bbar

  1. #1
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Question [SOLVED]Gridpanel + height + bbar

    Hi,

    I have a strange behaviour (bug?) with my gridpanel. When I set the height property, the pagingtoolbar disapear (FF and IE).
    Code:
    var gp_lopdata = new Ext.grid.GridPanel({
        id: 'gp_lopdata',
        ds: ds_lop,
        cm: cm_lop,
        frame: true,
        border: false,
        autoScroll: true,
        loadMask: new Ext.LoadMask(Ext.getBody(), {
            msg: 'Please wait...'
        }),
        sm: new Ext.grid.RowSelectionModel({
            singleSelect: true
        }),
        viewConfig: {
            forceFit: true
        },
        listeners: {
            'cellcontextmenu': function(grid, row, col, e){
                myMenu.showAt(e.getXY());
                Ext.getCmp('myMenuLabel').setText('(' + row + ',' + col + ')');
                e.stopEvent();
            }
        },
        bbar: new Ext.PagingToolbar({
            id: 'pgb_gp_lop',
            pageSize: gridlinebypage,
            store: ds_lop,
            displayInfo: true,
            displayMsg: 'Displaying records {0} - {1} of {2}',
            emptyMsg: "No records to display",
            items: [new Ext.Toolbar.Separator(), {
                xtype: 'label',
                text: 'Adonis'
            }, {
                xtype: 'numberfield',
                id: 'lookthisadonis',
                fieldLabel: 'Adonis',
                allowDecimals: false,
                allowNegative: false,
                maxValue: 999999,
                enableKeyEvents: true
            }, {
                xtype: 'button',
                id: 'btn_filterlop',
                icon: 'images/find.png',
                tooltip: 'Search specific ADONIS',
                handler: function(){
                    if (Ext.getCmp('lookthisadonis').getValue()) {
                        ds_lop.baseParams = {};
                        Ext.apply(Ext.getCmp('gp_lopdata').getStore().baseParams, {
                            filters: 'Adonis',
                            Adonis_eq: Ext.getCmp('lookthisadonis').getValue()
                        });
                        Ext.getCmp('gp_lopdata').getStore().load({
                            params: {
                                start: 0,
                                limit: gridlinebypage,
                                useralias: loc_useralias,
                                userprofile: loc_userprofile
                            }
                        });
                    }
                }
            }, {
                xtype: 'button',
                id: 'btn_clearfilterlop',
                icon: 'images/reload16.png',
                tooltip: 'Clear filter/Show all adonis',
                handler: function(){
                    Ext.getCmp('gp_lopdata').getStore().baseParams = {};
                    Ext.getCmp('lookthisadonis').setValue('');
                    Ext.getCmp('gp_lopdata').getStore().load({
                        params: {
                            start: 0,
                            limit: gridlinebypage,
                            useralias: loc_useralias,
                            userprofile: loc_userprofile
                        }
                    });
                }
            }]
        })
    });

    Another point that with this config (without the height) when I search (btn_filterlop) it returns 1 result and the grid is automatically resized which is not a problem itself. The problem is when I clear the search (btn_clearfilterlop) the grid is not automatically resized and there is no vertical scrollbar. The data is well loaded.




  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Can you read that code?

    Format it properly, and someone might help/

  3. #3
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,675

    Default

    i think we need a button with "JAVASCRIPT CODE" insted of "#"- users post code in very strange ways
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  4. #4
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Default

    Quote Originally Posted by Animal View Post
    Can you read that code?

    Format it properly, and someone might help/
    hum strange indeed...

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Erugh! Rendering. No layouts. The usual.

  6. #6
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Default

    Code:
        var p_bodycenter = new Ext.Panel({
    		id: 'p_bodycenter',
    		layout: 'card',
    		region: 'center',
    		loadMask: new Ext.LoadMask(Ext.getBody(), {
    			msg: 'Please wait...'
    		}),
    		border: false,
    		frame: true,
    		autoScroll: true
    	});
    ...
    	var p_lopdata = new Ext.Panel({
    		id: 'p_lopdata',
    		autoScroll: true,
    		items: [gp_lopdata, tp_lopdata]
    	});
            p_bodycenter.add(p_lopdata);
    ....
    	var vp_bodyviewport = new Ext.Viewport({
    		id: 'VP_BodyViewPort',
    		layout: 'border',
    		frame: false,
    		border: true,
    		items: [p_bodyright, p_bodycenter],
    		renderTo: 'container'
    	});
    	p_bodycenter.getLayout().setActiveItem('fp_login');
    My grid is set on a panel that is part of a viewport.

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Code:
    var p_lopdata = new Ext.Panel({
    		id: 'p_lopdata',
    		autoScroll: true,
    		items: [gp_lopdata, tp_lopdata]
    	});
    How do you think p_lopdata is going to size and position those two child items?

  8. #8
    Sencha Premium User
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    265

    Default

    I should think sleeping more ... What ever...
    Code:
    var gp_lopdata = ... (
    {...
    region:'north',
    height:200,...
    });
    var tp_lopdata = ... (
    {...
    region:'center',...
    });
    	var p_lopdata = new Ext.Panel({
    		id: 'p_lopdata',
    		autoScroll: true,
    		layout:'border',
    		items: [gp_lopdata, tp_lopdata]
    	});
    Sorry for your time lost on this...
    [STICKYNOTE]ALLWAYS SET THE RIGHT LAYOUT PROPERTY[/STICKYNOTE]

Posting Permissions

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