[CLOSED] Setting the IDProperty when using a TreePanel

  1. #1

    [CLOSED] Setting the IDProperty when using a TreePanel

    In the following example if i open the root node the method LoadTree is called passing the nodeID parameter, in other works, it runs as expected.

    But if i set the IDProperty of the Model _mdl the nodeID parameter is passed as a blank string.

    Any ideas to overcome this problem?

    <ext:TreePanel ID="_tp" UseArrows="true"  Title="Tree" Height="500" Width="500" Border="false"
        runat="server">
        <Store>
            <ext:TreeStore ID="_ts" runat="server" NodeParam="nodeID">
                <Proxy>
                    <ext:AjaxProxy Url="/Example/LoadTree/">
                        <ActionMethods Read="POST" />
                        <Reader>
                            <ext:JsonReader Root="data">
                            </ext:JsonReader>
                        </Reader>
                    </ext:AjaxProxy>    
                </Proxy>
                <Model>
                    <ext:Model ID="_mdl" runat="server">
                        <Fields>
                            <ext:ModelField Name="ID" />
                            <ext:ModelField Name="Lastname" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:TreeStore>
        </Store>
        <Root>
            <ext:Node NodeID="0" Text="Root" />
        </Root>
        <ColumnModel>
            <Columns>
                <ext:TreeColumn ID="_cln1" runat="server" Text="ID" DataIndex="ID" />
                <ext:Column ID="_cln2" runat="server" Text="Lastname" Sortable="true" DataIndex="Lastname" />
            </Columns>
        </ColumnModel>
    </ext:TreePanel>
    public StoreResult LoadTree(string nodeID)
    {
    
    }
    Last edited by Daniil; May 18, 2012 at 4:54 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You should set up IDProperty of the JsonReader. Does it help?
  3. #3
    it works If i set JUST the IDProperty of JsonReader. But when i use GridPanel i just need to set the IDProperty of Model. I wonder the reason of differente between GridPanel and TreePanel.
  4. #4
    Set IDProperty for Model should be enough
    Do you return 'ID' field in your data?

    For example, I see that Root node has no ID (it uses standard NodeID only)
    Why do you want to change standard IDProperty? Id field has another name in your data?

Similar Threads

  1. [CLOSED] How to get the value for the IdProperty in a Model
    By Fahd in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 03, 2012, 2:10 PM
  2. Replies: 0
    Last Post: May 16, 2012, 4:35 PM
  3. [CLOSED] Drag and drop from treepanel to treepanel in "copy" mode
    By mattwoberts in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 14, 2011, 6:45 PM
  4. Replies: 5
    Last Post: Mar 23, 2011, 9:57 AM
  5. Dynamically changing Treepanel other Treepanel
    By airforcz in forum 1.x Help
    Replies: 0
    Last Post: Jun 16, 2010, 8:33 AM

Posting Permissions