[CLOSED] Change Badge on Tabpanel in code behind

  1. #1

    [CLOSED] Change Badge on Tabpanel in code behind

    Hello again ;-)

    I want to show a badge with the number of records on my tab of the tabpanel.
    I had the badge implemented in the Plugins collection of the TabConfig of the panel (a grid panel in this case).
    I have given the badge an ID.
    Now I would like to change the Badges Text in the Refresh function of my store (server side), by using:
    badgeCompanies.Text = totalNumberOfRows.ToString();

    This gives me an error that I need to set the widgets ID before calling its functions. But it is set...

    I tried via X.Msg.Badge("mygridpanel", totalNumberOfRows.ToString()).Show(), but that shows the badge at the full right of the panel and not on the tab on top.

    I tried also via X.GetCmp<Ext.Net.Badge>("badgeCompanies").Text... , but that gave the same error in regards to the widget ID issue.

    How can that text of that badge be changed server side?

    Kind regards,

    Reno
    Last edited by Daniil; Nov 17, 2014 at 2:34 PM. Reason: [CLOSED]
  2. #2
    Hello @reno,

    It appears a BadgeID.Text works for me during a DirectEvent.

    Please provide a test case.
  3. #3
    Hello Daniil,

    The BadgeID.Text works also for me, except when it is in TabConfig plugins section, then it is not.

    Kind regards,

    Reno
  4. #4
    Please set IDMode="Explicit".
    <TabConfig runat="server">
        <Plugins>
            <ext:Badge ID="TabBadge" Text="Tab Badge" IDMode="Explicit" />
        </Plugins>
    </TabConfig>
    Internally, a TabConfig has IDMode="Ignore" and everything inside inherits it. IDMode="Ignore" causes an id to be not rendered to client. It all leads to the Exception that you have faced.
  5. #5
    many thanks!

Similar Threads

  1. Badge and UI
    By claudioalfonso in forum 2.x Help
    Replies: 5
    Last Post: Jun 12, 2014, 5:05 AM
  2. Replies: 4
    Last Post: Jun 11, 2014, 8:51 AM
  3. Badge on DataView Items
    By inteligencija in forum 2.x Help
    Replies: 0
    Last Post: May 12, 2014, 7:16 AM
  4. TabPanel : Badge and UI
    By brunweb in forum 2.x Help
    Replies: 2
    Last Post: Mar 14, 2014, 11:07 AM
  5. [CLOSED] Tabpanel in tabpanel from code behind
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 29, 2008, 7:56 AM

Posting Permissions