Results 1 to 2 of 2

Thread: dynmic loaded html to tab pannel not show auto

  1. #1
    Sencha User
    Join Date
    Nov 2016
    Posts
    1

    Default dynmic loaded html to tab pannel not show auto

    I'm test extjs.
    I've some old code, I don't rewrite everything.

    My old code is a lot's of partial view (c# mvc razor). It will gererate some HTML + JS CODE (SlickerGrid related).

    I create a tabs, and then, dynamic load the partial view into one tab added. The code looks like this

    Code:
    //load after user click
    function loadPartialViewToTab(tabs, url,title)
    {
    var tab = tabs.add({
       title: title,
               xtype: 'panel',        layout: 'fit',
            closable :true,
            title: title,
            loader: {//Ext.ComponentLoader
                autoLoad: true,
                loadMask: true,
                url: url,
                scripts: true
           }
    });
    
    tabs.setActiveTab(tab);
    }
    the partial view is loaded as expected.
    But only one thing abnormal: it was not showed.
    If a switch to another TAB, and then switch back, it will show properly.

    It seems some fuction like refresh or reLayout need to be called.

    How to deal with this?

    I have searched google and bing and here, nothing helped.


    I'm using extjs v6.5.2 for test.

    the partial view looks like this

    Code:
    <div id="GridDiv"></div>
    
    
    <script type="text/javascript">
    
    
        Ext.onReady(function () {
            //load data from a url and show it via SlickerGrid
        });
    </script>

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892
    Answers
    41

    Default

    Try setting the tab to active in the callback of the load call.

Similar Threads

  1. [CLOSED] Models with 'auto' property is not loaded correctly in Ext.JS 5
    By ChristianSA in forum Ext 5: Bugs
    Replies: 2
    Last Post: 1 Oct 2014, 5:01 AM
  2. Replies: 1
    Last Post: 6 Aug 2013, 6:40 AM
  3. Switch pannel on click on a html element
    By jbmeneroud in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 7 Mar 2012, 4:59 AM
  4. Adding a record to a store that is auto loaded
    By oshannon in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 28 Jul 2009, 7:27 AM
  5. added pannel dosent show
    By captainsina in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 27 Apr 2008, 9:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •