我试过下面的代码。
我正在使用该版本https://www.nuget.org/packages/Ext.NET.MVC/3.2.0
TreePanel treePanel = new TreePanel();
treePanel.ID = "TreePanel1";
treePanel.RootVisible = false;
treePanel.DirectEvents.ItemClick.Url = "/Menu/TreePanelClickHandler";
treePanel.DirectEvents.ItemClick.Method = HttpMethod.POST;
treePanel.DirectEvents.ItemClick.ExtraParams.Add(new Parameter("param1", "value1", ParameterMode.Value));
treePanel.DirectEvents.ItemClick.ExtraParams.Add(new Parameter("param2", "value2", ParameterMode.Value));
控制器
public class MenuController : Controller
{
public ActionResult TreePanelClickHandler(string param1,string param2)
{
X.Msg.Alert("server-side:", param1 + "\n" + param2).Show();
AjaxResult r = new AjaxResult();
return r;
}
}
任何想法?
答案 0 :(得分:2)
create table so_gibberish.fred1
(
id int auto_increment primary key,
what varchar(40) not null
);
insert so_gibberish.fred1 (what) values ('this'),('that');
insert into newdb789.fred1 select * from so_gibberish.fred1;
-- failed, error code 1146: Table 'newdb789.fred1' doesn't exist
create table newdb789.fred1
(
id int auto_increment primary key,
what varchar(40) not null
);
insert into newdb789.fred1(id,what) select id,what from so_gibberish.fred1;
insert into newdb789.fred1 (what) values ('a new thing');
select * from newdb789.fred1;
+----+-------------+
| id | what |
+----+-------------+
| 1 | this |
| 2 | that |
| 3 | a new thing |
+----+-------------+
当Ext.Net.Node创建
时TreePanel treePanel = new TreePanel();
treePanel.ID = "TreePanel1";
treePanel.Border = false;
treePanel.RootVisible = false;
treePanel.DirectEvents.ItemClick.Before = "o.extraParams.param1 = record.data.id; o.extraParams.param2 = record.data.text; o.extraParams.param3 = record.raw['tag'];";
treePanel.DirectEvents.ItemClick.Url = "/Menu/ClickMeHandler";
treePanel.DirectEvents.ItemClick.Method = HttpMethod.POST;
控制器
subNode.CustomAttributes.Add(new ConfigItem("tag", "testdata"));