-
Code behind ExtraParams
In Code behind you can nicely hook an event on TreePanel
like this
Code:
Ext.Net.TreePanel tr = new Ext.Net.TreePanel();
tr.DirectEvents.Click.Event += nodeClicked;
however if lets say node has attributes how we pass it on extra params ???
Code:
Ext.Net.Parameter prm = new Ext.Net.Parameter();
prm.Value ="{#{" + tr.ID + "}.node.attributes.tagName}"; //this does not work. Any ideas????
prm.Name = "ReportID";
tr.DirectEvents.Click.ExtraParams.Add(prm);
-
Hi,
Is this code throwing a JavaScript error? If you use Firefox with the Firebug extension, does Firebug log any errors or exceptions?
What if you use the following:
Example
Code:
Ext.Net.Parameter prm = new Ext.Net.Parameter();
prm.Value = "#{" + tr.ID + "}.node.attributes.tagName"; //this does not work. Any ideas????
prm.Name = "ReportID";
prm.Mode = ParameterMode.Raw;
tr.DirectEvents.Click.ExtraParams.Add(prm);
Providing a simplified code sample demonstrating the whole scenario will help narrow down the problem.
-
Thank you for replying
previously the the parameter was not coming as numeric value but as whole statement so if i wanted to consume extra parameter it was something like "node.attributes.tagName" after adding prm.Mode = ParameterMode.Raw; Script fails to load. Firebug gives a message missing : after id
the scenarion is that when the tree is created I am adding some custom attributes to leaf nodes . like this
Code:
trNode.CustomAttributes.Add(new ConfigItem(string.Format("'{0}'", xAttr.Name), string.Format("'{0}'", xAttr.Value)));
when user clicks the leaf node I want to consume that attributes so hook up direct event
Code:
tr.DirectEvents.Click.Event += nodeClicked;
tr.ID = xNode.Name;
Ext.Net.Parameter prm = new Ext.Net.Parameter();
prm.Value = "{ #{" + tr.ID + "}.node.attributes.ReportID } ";
prm.Name = "ReportID";
prm.Mode = ParameterMode.Raw;
tr.DirectEvents.Click.ExtraParams.Add(prm);