[CLOSED] Set CycleButton Active Item in Code Behind

  1. #1

    [CLOSED] Set CycleButton Active Item in Code Behind

    Good Morning

    I use a Cycle Button an my Screen. Normally the Active Item is Set in JS
      cmdMode.setActiveItem(0, true);
    In one case the Button should be handled in Code Behind (VB.NET)...

    I tried this
     cmdMode.ActiveItem.Set("0", True)
    but that seems to be wrong :-(

    Could you please tell me how to solve this Problem ?

    Peter
    Last edited by Daniil; Jun 11, 2014 at 1:28 PM. Reason: [CLOSED]
  2. #2
    Hi Peter,

    Please use
    cmdMode.ActiveItemIndex = 0;
  3. #3
    Quote Originally Posted by Daniil View Post
    cmdMode.ActiveItemIndex = 0;
    Hmm, I tried that but it causes this error :

    Unable to cast object of type 'Ext.Net.MenuItem' to type 'Ext.Net.CheckMenuItem'.

    Here's my mark up

                    <ext:CycleButton ID="cmdMode" runat="server" ShowText="true" PrependText="CRMCycleButtonText">
                      <Menu>
                        <ext:Menu ID="mnuMode" runat="server">
                          <Items>
                            <ext:MenuItem ID="mnuExternalContact" runat="server" Text="ContactExternal" Icon="UserEarth" />
                            <ext:MenuItem ID="mnuCompany" runat="server" Text="Company" Icon="House" />
                          </Items>
                        </ext:Menu>
                      </Menu>
                    </ext:CycleButton>
    Any Idea ?
  4. #4
    I've reproduce. I think we will fix that very soon in the trunk.

    Please try this for now.
    cmdMode.Call("setActiveItem", 0);
  5. #5
    There is a limitation with a CycleButton. It is supposed to be working with CheckMenuItems only.
    http://docs.sencha.com/extjs/4.2.1/#...t.button.Cycle

    Here is a related issue - CycleButton breaks if add a non-CheckItem into its menu

    I fixed that a while ago.

    Though, now, it is problematic to fix the ActiveTabIndex/ActiveItem issue. I think we will leave it for now as it is. Please use the suggested solution, it appears to be good enough.

    I've added the thread to the Issue's description. Maybe, at some point we will revise that.
  6. #6
    Thanks Daniil, I'll do this :-)

    Quote Originally Posted by Daniil View Post
    There is a limitation with a CycleButton. It is supposed to be working with CheckMenuItems only.
    http://docs.sencha.com/extjs/4.2.1/#...t.button.Cycle

    Here is a related issue - CycleButton breaks if add a non-CheckItem into its menu

    I fixed that a while ago.

    Though, now, it is problematic to fix the ActiveTabIndex/ActiveItem issue. I think we will leave it for now as it is. Please use the suggested solution, it appears to be good enough.

    I've added the thread to the Issue's description. Maybe, at some point we will revise that.

Similar Threads

  1. Replies: 6
    Last Post: May 01, 2013, 3:35 AM
  2. [CLOSED] CycleButton active item
    By smart+ in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 01, 2011, 12:20 PM
  3. Replies: 2
    Last Post: Apr 25, 2010, 2:15 AM
  4. Replies: 5
    Last Post: Mar 05, 2010, 5:08 AM
  5. [CLOSED] active item bug with multiple gridpanels
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 06, 2009, 1:51 PM

Posting Permissions