我正在使用示例 -
我想将所选节点的值传递给控制器。文章的作者正在消息框中显示值;我想 在同一页面的TextBox中显示所选项目的文本或 id 或将其传递给控制器。任何人都可以帮我做吗?
谢谢,
我正在使用示例 -
我想将所选节点的值传递给控制器。文章的作者正在消息框中显示值;我想 在同一页面的TextBox中显示所选项目的文本或 id 或将其传递给控制器。任何人都可以帮我做吗?
谢谢,
试试这个(未经测试):
function getChecked(){
divId = [];
$("#onflycheckboxes").jstree("get_checked", null, true).each(function () {
divId.push(this.id);
});
$.ajax({
url: "/MyController/Action",
type: "POST",
dataType: "json",
data: {divIds: divId},
contentType: "application/json charset=utf-8"
})
}
MVC 控制器 ( MyControllerController.cs
)
[HttpPost]
public ActionResult Action(object[] divIds=null)
{
//break here and view the results of divIds.
return Json("success");
}