PDA

View Full Version : [CLOSED] Setting the IDProperty when using a TreePanel



RCN
May 11, 2012, 12:35 PM
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)
{

}

Daniil
May 11, 2012, 3:35 PM
Hi,

You should set up IDProperty of the JsonReader. Does it help?

RCN
May 11, 2012, 6:45 PM
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.

Vladimir
May 11, 2012, 7:57 PM
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?