May 29, 2016, 10:11 PM
ActionItem handler.
I am creating a TreePanel inside a window on the code behind.
Simplified code is posted at the end of the post.
What I am trying to achieve is similar to example in here :
LINK
but with one small change. Instead of having javascript function in cshtml page I created DirectMethod to handle click on the ActionItem.
But there seems to a problem be with some json encoding (recurrsion in serialization maybe?).
After clicking the action item I see this :
My other direct methods from this namespace works just fine ( used by buttons and message boxes).
I don't know if it matters but tree panel is being build from another project in my visual studio solution, however from the same project I build message boxes and they all work.
Tree panel is being build as follows :
Obviously, creating handler
Simplified code is posted at the end of the post.
What I am trying to achieve is similar to example in here :
LINK
but with one small change. Instead of having javascript function in cshtml page I created DirectMethod to handle click on the ActionItem.
But there seems to a problem be with some json encoding (recurrsion in serialization maybe?).
After clicking the action item I see this :
My other direct methods from this namespace works just fine ( used by buttons and message boxes).
I don't know if it matters but tree panel is being build from another project in my visual studio solution, however from the same project I build message boxes and they all work.
Tree panel is being build as follows :
var panel = new TreePanel();
var action = new ActionItem
{
Handler = "Namespace.Method",
};
panel.ColumnModel.Columns.Add(
new ActionColumn
{
Text = "Edit",
MenuDisabled = false,
Align = Alignment.Center,
Items = { action },
}
);
In my controller method which I am trying to call looks as follows : [DirectMethod(Namespace = "Namespace")]
public ActionResult Method
(params object[] param) // result doesn't change if I change it to anything else
{
return this.Direct(); // result doesn't change if I change it for example to this.Redirect("anothercontroller");
}
Obviously, creating handler
Handler="Method()"
works but all arguments are null.