TreePanel Ajax Method Loader by code
New Community Forums available at http://forums.ext.net
 

Coolite Forums

Welcome Guest ( Login | Register )
 
TreePanel Ajax Method Loader by code
Subscribe
Last Login: 6/30/2010 1:13:30 PM
Posts: 9,
Posted 12/8/2009 8:41:39 AM

Group: Coolite Early Adopter

Hi guys,

In all samples of TreePanel in the source code the part in which we create listeners is in html code, but How to do this in code??? Because my tree panel is created dinamically.

The part of html code that I need in c# code is in a big letter.


 <ext:TreePanel
            ID="TreePanel1"
            runat="server"
            Title="Tree"
            AutoHeight="true"
            Border="false">
            <Root>
                <ext:AsyncTreeNode NodeID="0" Text="Root" />
            </Root>
            <Listeners>
                <BeforeLoad Fn="nodeLoad" />
            </Listeners>
        </ext:TreePanel> 



Please help me.

Mickna.
Last Login: 7/8/2010 1:50:34 AM
Posts: 4,722,
Posted 12/8/2009 8:45:10 PM

Group: Core Development Team
Hi Mickna,

Example

this.TreePanel1.Listeners.BeforeLoad.Fn = "nodeLoad";

Hope this helps.

--
Geoffrey McGill
Coolite Inc.
Development Team
Skype : geoffrey.mcgill
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 6/30/2010 1:13:30 PM
Posts: 9,
Posted 12/11/2009 11:28:36 AM

Group: Coolite Early Adopter
 Yes, I know but if I need to have the nodeLoad method that receives another parameter for example:


[AjaxMethod]
public string NodeLoad(string nodeID  Coolite.Ext.Web.AsyncTreeNode  node)
{
/*******Code*********/
}

How can I do that by code????

Mickna.
Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 12/11/2009 11:46:21 AM

Group: Core Development Team
Hi,

Why do need whole node? May be pass node id only? 

--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 6/30/2010 1:13:30 PM
Posts: 9,
Posted 12/11/2009 11:56:23 AM

Group: Coolite Early Adopter
 I need the node because inside the NodeLoad method I need information of the node. Mickna.
Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 12/11/2009 12:11:12 PM

Group: Core Development Team
Hi,

Then pass required information as additional arguments. Javascript TreeNode object is very comples (for example, contains reference on parent tree) and can't be automatic serialized (even if it is possible then why is required to pass such huge information to server). Use simple objects

1.
Coolite.AjaxEvents.MyMethod(Ext.encode({Id: node.id, Text: node.text}))
2.
public class SimpleNode{ public string Id{...} public string Text {...}}
3. AjaxMethod:
public void MyMethod(SimpleNode node){...

--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 6/26/2010 11:35:01 PM
Posts: 87,
Posted 1/5/2010 7:34:45 PM

Group: Coolite Premium Member & Early Adopter
 This is how I load my treenodes as well, and it works great, but I have a question. Is it possible to page the results when using this method, and how would you go about doing that?
« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -5:00, Time now is 8:41pm