Deniplane
Deniplane

Reputation: 415

Can't redraw Panel in ExtJS

I made the sufficient investigation of this problem. But unfortunately didn't find any solution, even in stackoverflow questions, that look like this one. I need to redraw(refresh, re-render) a panel, that contains a tabPanel with different tabs, that are rebuilding each time when I open the panel. Here is the code below to build tabs

//the first tab
categoryTpl: function(){
    var categoriesTab = new Ext.Panel({
    id: '_Categories',
    title: 'X-Axis',
        layout: 'form',
    padding: 10,
    labelWidth: 101,
    items: [...]
    })
}

Here is code to build the TabPanel

setAxesInfo: function(){
    var categoryTab = this.categoryTpl();
    //initialize the controls in the first tab
    FC.Var.CM.initAxis(categoryTab, undefined);

    delete this.axesTabPan;
    this.axesTabPan = new Ext.TabPanel({
        activeTab: 0,
        plain: true,
        enableTabScroll: true,
        autoScroll: false,
        defaults: { autoScroll: true },
        items: [categoryTab]
    });
}

This is the code to build Panel

create: function(){ 

    this.setAxesInfo();

    this.axes = new Ext.Panel({
        layout: 'fit',
        border: false,
        items: this.axesTabPan
    });

    return {
        id: 'axesStep',
        title: 'Series Customization',
        items: this.axes
    }
}

So, I make changes in tab controls and then I want to rebuild(refresh, re-render) my panel I click the button, which have the next handler

refreshAxes: function() {   
   this.axes.removeAll();

   this.setAxesInfo();

   this.axes.add(this.axesTabPan);

   this.axes.doLayout();
}

So, in debugger I can see, that all my controls in the tab have default initial values (they were rebuilt as I see). But in the browser I see only the previous changed values. It's notable, that if I change the focus of my panel (for example switch to another panel) and then return to this panel all data have the default values. Why I don't see the default values without loosing focus?

I am using the Ext Js 3.4 (this version is the requirement). I'll appreciate any help. Thank you.

Upvotes: 3

Views: 3830

Answers (1)

dmackerman
dmackerman

Reputation: 2966

Try doing a doLayout() on the Panel.

Upvotes: 1

Related Questions