[CLOSED] TabPanel - ActiveIndex - Not working

  1. #1

    [CLOSED] TabPanel - ActiveIndex - Not working

    ActiveIndex doesn't work. I have also tried ActiveItem.

    @{
        var x = Html.X(); 
    }
     @(
        x.TabPanel()
            .ActiveIndex(1)
            .Items(
                x.Panel()
                    .Title("Panel0")
                ,
                x.Panel()
                    .Title("Panel1")
            )
     )
    Last edited by fabricio.murta; Aug 17, 2016 at 1:40 AM.
  2. #2
    Hello @sveins12!

    I am afraid this setting is not meant to work on tab panels like you expect.

    By its description (you can see using IntelliSense on your development environment), you read:
    // Summary:
    // A string component id or the numeric index of the component that should be
    // initially activated within the container's layout on render. For example,
    // activeItem: 'item-1' or activeItem: 0 (index 0 = the first item in the container's
    // collection). activeItem only applies to layout styles that can display items
    // one at a time (like Ext.layout.container.Card and Ext.layout.container.Fit)
    And if you search forums for something like "TapPanel ActiveIndex", you can find a very very old thread mentioning it was made available. As of Ext.NET 0.6 -- whence it was called Coolite) but then you can find a earlier threads which indicates this no longer was the case since Ext.NET 1.0, probably due to conflicting applications of the same setting.

    In this thread Vladimir suggests us to use ActiveTabIndex() instead: TabPanel 'ActiveItem/Index' property.

    And, by a matter of fact, this just worked for me here! Sorry it may look confusing, I didn't dig really deep for the actual reason this ceased to be applicant to Ext.NET but I could notice:
    - it is not inherent from Sencha ExtJS
    - it was once implemented exactly because it was confusing
    - later, it was no longer actual, and a specific setting ActiveTabIndex was created to handle the same behavior.

    It really looks like trouble trying to make it "general" as history indicates it probably suppressing the actual ActiveIndex functionality in some scenarios using the TabPanel.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thank you. ActiveTabIndex(1) works.

Similar Threads

  1. [CLOSED] TabPanel setActiveTab is not working in clientside
    By rguardado in forum 3.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 23, 2015, 7:38 AM
  2. HtmlEditor not working on TabPanel
    By hoangdt in forum 2.x Help
    Replies: 2
    Last Post: Apr 26, 2014, 2:19 AM
  3. [CLOSED] Accordion ActiveIndex
    By Adrian in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 11, 2013, 11:47 AM
  4. [CLOSED] Coolite Ext TabPanel Not Working
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Jul 26, 2010, 10:47 AM
  5. set activeindex in card layout
    By maxdiable in forum 1.x Help
    Replies: 2
    Last Post: Jun 28, 2010, 10:51 AM

Posting Permissions