[CLOSED] DirectEvent tabchange in tabpanel tab.items.count always 0 on server side.

  1. #1

    [CLOSED] DirectEvent tabchange in tabpanel tab.items.count always 0 on server side.

    Hi,

    similar question being asked before here is link: http://forums.ext.net/showthread.php...count-always-0

    but I need to use DirectEvent in my case is there any way for getting this items count and pass it through extraparams or something like that?

    Edit:
    I found something like this :
    "tab.items.getCount()"
    but how to pass it through extraparams?

    Regards,
    ViDom
    Last edited by Daniil; Oct 05, 2012 at 1:49 PM. Reason: [CLOSED]
  2. #2
    Hi @ViDom,

    Example
    <ExtraParams>
        <ext:Parameter Name="count" Value="tabPanel.items.getCount()" Mode="Raw" />
    </ExtraParams>
    Access it in the DirectEvent handler this way.
    e.ExtraParams["count"]
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @ViDom,

    Example
    <ExtraParams>
        <ext:Parameter Name="count" Value="tabPanel.items.getCount()" Mode="Raw" />
    </ExtraParams>
    Access it in the DirectEvent handler this way.
    e.ExtraParams["count"]
    That's my point but it's throw exception :
    Property 'ExtraParams' does not have a property named 'Name'.
    Maybe I doing something wrong? here's my code:
    <ext:TabPanel ID="tPanel" AutoHeight="True" runat="server" Height="40" Border="false" Collapsed="True" Visible="False"
                Collapsible="True" Title="Zlinkowane listy" ActiveIndex="0">            
                <DirectEvents>
                    <TabChange Before="if (!this.ignoredFirstTabChange) { this.ignoredFirstTabChange = true; return false; }" OnEvent="tPanel_TabChange">
                        <ExtraParams Name="count" Value="tab.items.getCount()" Mode="Raw"></ExtraParams>
                    </TabChange>
                </DirectEvents>
            </ext:TabPanel>
    btw. your code
    tabPanel.items.getCount()
    will produce javascript error tabPanel is undefined in sencha docs there is tab element in tabChange event;)

    Edit solution for my problem:
    <ext:TabPanel ID="tPanel" AutoHeight="True" runat="server" Height="40" Border="false" Collapsed="True" Visible="False"
                Collapsible="True" Title="Zlinkowane listy" ActiveIndex="0">            
                <DirectEvents>
                    <TabChange Before="if (!this.ignoredFirstTabChange) { this.ignoredFirstTabChange = true; return false; }" OnEvent="tPanel_TabChange">
                        <ExtraParams>
                                <ext:Parameter Name="count" Value="tab.items.getCount()" Mode="Raw" />
                        </ExtraParams>
                    </TabChange>
                </DirectEvents>
            </ext:TabPanel>
  4. #4
    Please try this.
    Value="this.items.getCount()"
  5. #5
    Quote Originally Posted by Daniil View Post
    Please try this.
    Value="this.items.getCount()"
    there is no problem with
    Value
    there is error occured because ExtraParams does not contain property named
    Name
    Is it normal? because I've no warning in markup (normally resharper make warning/errors if something does not exist.)

    for clear all doupts:

    I don't need to count of tabs in tabPanel(your code does that) but what I need is get count of items in specific activated tab:)
  6. #6
    Please have another look at my example. You missed <ext:Parameter>.
  7. #7
    Quote Originally Posted by Daniil View Post
    Please have another look at my example. You missed <ext:Parameter>.
    Yeah that was the problem. Now I feel like a total noob in ext.net :(

    Thanks again Daniil your help is invaluable:)
  8. #8
    You will become the best soon:)

Similar Threads

  1. [CLOSED] Server side controls values with DirectEvent calls
    By Daniil in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 10, 2012, 11:52 AM
  2. Replies: 1
    Last Post: Dec 01, 2010, 5:14 PM
  3. Replies: 1
    Last Post: Jul 21, 2010, 9:11 PM
  4. [CLOSED] Item Count for Store - Server Side
    By JD in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 02, 2010, 9:07 AM
  5. How to get items in Multiselect in Server side
    By Nagaraj K Hebbar in forum 1.x Help
    Replies: 2
    Last Post: Sep 25, 2009, 3:30 AM

Tags for this Thread

Posting Permissions