2012-04-30 34 views
-1

现在我使用ExtJS的3.4得到这种形式:ExtJS的 - 使用getForm问题()

config = Ext.apply({ 
    title: 'Fluxo de Reincidencia', 
    id: 'formKMLRcd', 
    name: 'formKMLRcd', 
    border: true, 
    bodyStyle: "padding: 10px", 
    layout: "form", 
    autoScroll: false, 
    items: [{ 
     xtype: "datefield", 
     ref: "../extent", 
     anchor: "100%", 
     fieldLabel: 'Data Inicio', 
     emptyText: 'informe a data de inicio', 
     name: 'txtRcdDataInicio', 
     id: 'txtRcdDataInicio', 
     format: 'd/m/Y', 
     altFormats: 'd/m/Y', 
     allowBlank: false, 
     validator: function (value) { 
      var date = this.parseDate(this.getValue()); 
      if (!date) { 
       return 'Informe uma data valida'; 
      } 
     } 
    } 

我怎样才能得到表单对象,我试图用这种表达,但没有sucess。

var form = Ext.getCmp('formKMLRcd').getForm(); 

谢谢!

回答

1

您使用Ext.apply错了,你必须指定作为第一个参数,要应用指定的配置(在你的情况下,面板)的objecton

+0

效果很不错! 谢谢! –