Feb 08, 2013, 12:28 PM
How to get parent id of treepanel selected node)
Hi,
I've been spending hours to get parent id of currently selected node of a treepanel. I could find the parent in server side but, couldn't convert it to node type. I need an urgent reply... Here you can see my codes.
I've been spending hours to get parent id of currently selected node of a treepanel. I could find the parent in server side but, couldn't convert it to node type. I need an urgent reply... Here you can see my codes.
if(#{tpPotentialAndTargetInfo}.getSelectionModel().hasSelection())
{
var nodeId = #{tpPotentialAndTargetInfo}.getSelectionModel().getSelection()[0].data.id;
#{DirectMethods}.UpdatePotentialAndTarget(nodeId);
}
[DirectMethod]
public void UpdatePotentialAndTarget(string id)
{
var subCategory= tpPotentialAndTargetInfo.GetNodeById(id); // this code returns nodeproxy.
var category = subCategory.ParentNode();
var mainCategory = category.ParentNode();
var puarId = mainCategory.ParentNode();
}
Last edited by Daniil; Feb 11, 2013 at 4:56 AM.
Reason: Please use [CODE] tags