开发者

extjs show validation when switching tabs

HI, I hope somebody can help me here with the extjs framework.

The problem I am having is that the field validation is not being rendered for the tabs that are not visibele on initialisation off the panel.

It only starts working when clicking in the textfields.

What I need is something to force the validation cue's for the fields on activating the tabs.

EDIT I came up with this

Ext.getCmp('aanMakenGebruikerTabPanel').on('tabchange',function(){
        AanMakenGebruikerWindow.syncShadow();
        Ext.getCmp('Mobiel1Veld').on('render',function(v){v.validate();});
        Ext.getCmp('Email1Veld').on('render',function(v){v.validate();});
        //console.log("[aanMakenGebruikerTabPanel] resize -- sync");
    });

EDIT I SOLVED IT BY USING THE CASCADE FUNCTION SO IT ALSO RE开发者_如何转开发ACHES ITEMS IN A FIELDSET.

Ext.getCmp('aanMakenGebruikerTabPanel').on('tabchange',function(tabPanel,tab){
        AanMakenGebruikerWindow.syncShadow();
        tab.cascade(function(item) {
   if (item.isFormField) {
    item.validate();
  }
} );
    });

thanks, Richard


The deferredRender option defaults to true. Will setting it to false help?

{
   xtype: 'tabpanel',
   deferredRender: false, 
   items: []
}


In your Tab Panel config object add listeners for the beforetabchange/tabchange event. In the handler you have to iterate through the fields contained in the activated tab and trigger each field's validation. Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜