1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    36
    Vote Rating
    0
    Hakkert is on a distinguished road

      0  

    Default Unanswered: ASP.NET MVC4 with extjs 4. Add partial view as panel to ext panel

    Unanswered: ASP.NET MVC4 with extjs 4. Add partial view as panel to ext panel


    Hi

    I have the following problem. I have a panel in a view

    Code:
    <scripttype="text/javascript">
        Ext.onReady(function(){
        var htmlPanel =Ext.create('Ext.panel.Panel',{
                id:'htmlpanel',
                name:'htmlpanel',
                title:'@ViewBag.Welcome',
                height:200,
                //items: [vorderingenGrid],
                renderTo:'panelTest',
                buttons:[{
                    text:'test',
                    listeners:{
                        click:function(){
    
                            $.get('/xxxxx/DetailsExtView',null,function(result){
                                //DOES NOT WORK
                                Ext.getCmp('htmlpanel').items.add(result);
                               // WORKS
                               //$('#ajaxTest').html(result);
                            });
                        }
                    }
                }]
            });
        });
    
    
    </script>
    
    <divid="panelTest"style="height:200px;"></div>
    
    <divid="ajaxTest">
    Now on the click of the button i want to add a partial view as an item to the panel.

    Code:
    @{
    Layout = "";
    }
    
    
    <scripttype="text/javascript">
    Ext.onReady(function(){
    Ext.create('Ext.panel.Panel',{
    id:'ahtmlpanel',
    name:'ahtmlpanel',
    title:'tessttt',
    height:100,
    renderTo:'test'
    });
    });
    
    </script>
    <divid="test"></div>
    I tried it without rendering it to the div and eval the result but it does not work. Anyone an idea on how to get this working.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,010
    Answers
    668
    Vote Rating
    460
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Ext.getCmp('htmlpanel').items.add(result);
    What is the value of result?

    You should just be able to create components and add them to others c1.add(c2)

    Scott.

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    14
    Vote Rating
    0
    dadaking is on a distinguished road

      0  

    Default


    Hello,

    if you have always your problem, I just have the same problem, this perhaps help you :

    Code:
    Ext.getCmp('IDPANEL').body.load({ url: 'URL TO CALL', scripts: true })

Thread Participants: 2