0

I have created a view

Ext.define("App.view.leaders.MyViewName", {
    extend: 'App.view.basePopup',
    xtype: 'MyViewName',
    config: <Ext.form.IPanel>{
        scrollable: 'vertical',           
        items: [
            {
                 xtype: 'fieldset',
                 title: 'Add New Auto Asset',
                 instructions: '<hr class="separate" />',
                 items: [
                     <Ext.field.ISelect>{
                         xtype: 'selectfield',
                         label: 'Borrower Position',
                         store: 'BorrowerPositionSelectorStore',
                     },
                     <Ext.field.ISelect>{
                         xtype: 'selectfield',
                         label: 'Asset Type',
                         store: 'AssetTypeSelectorStore',
                     },
                     {
                         xtype: 'textfield',
                         name: '',
                         label: 'Description'
                     },
                     {
                         xtype: 'numberfield',
                         name: '',
                         label: 'Value'
                     }                               
                 ]
             }
         ]
    }
});

and an instance of that view in a controller like:

var newObject = Ext.create("App.view.leaders.MyViewName");

and add it to another view dynamically like this:

var newAdd = this.getLeadDetail1003()
                 .down('leadDetail1003AssetsLiab')
                 .down('fieldset[itemId=AddCashAsset]');

newAdd.add(newObject);

but it is not added to the form! Can anyone please tell me what am I doing wrong or what I need to do now?

Andrea Casaccia
  • 4,802
  • 4
  • 29
  • 54
Rishabh Garg
  • 706
  • 1
  • 9
  • 28
  • Please avoid similar and duplicate questions – Albin Joseph Oct 14 '14 at 05:32
  • If you know then please give link to me.. i am not get any useful link yet now.. – Rishabh Garg Oct 14 '14 at 05:33
  • please add the following and let me know the result: console.log(this.getLeadDetail1003().down('leadDetail1003AssetsLiab').down('fieldset[itemId=AddCashAsset]')) – Dinkheller Oct 14 '14 at 07:05
  • Its reference that particular fieldset And on console it display all property of that fieldset. Yes one you have to know when i adding without making any view just write all view code in newAdd.add({ xtype:..... many other... }); it work. – Rishabh Garg Oct 14 '14 at 07:28
  • Please post the code of the view you are trying to add. Also, is `newObject` created correctly? – Andrea Casaccia Oct 14 '14 at 09:17
  • @Anubis 2 I Posted the view. – Rishabh Garg Oct 14 '14 at 12:02
  • What are those ``, `` in your view definition? I never saw that – Andrea Casaccia Oct 14 '14 at 12:40
  • These Are My Custom view.I created Custom componant.Treat it like simple xtype. For treat it xtype:panel and same as like xtype:selectfield. – Rishabh Garg Oct 14 '14 at 14:13
  • @grishabh I can just guess what could be the error, if you don't have any errors in your console, maybe the view has been added but has no height, and so it is not displayed? Did you try to inspect the panel with developer tools? Also, I posted this question about your code if you are interested in answering it: http://stackoverflow.com/questions/26364497/what-is-the-purpose-of-classnames-in-angle-brackets-in-definitions – Andrea Casaccia Oct 14 '14 at 15:30
  • Yes View Is Added in the panel. But it is not displaying.... So how can i display it... @Anubis – Rishabh Garg Oct 16 '14 at 04:24
  • Give more informations, I'm not here to do your job – Andrea Casaccia Oct 16 '14 at 05:30
  • I am not Force to any one to do my Job but here i want to take guidance. – Rishabh Garg Oct 16 '14 at 05:35

0 Answers0