jquery - How to pass values from JSTree Menu to MVC controller -
i using example in -
i want pass values of selected node controller. author of article displaying values in message box; i want show selected item's text or id in textbox in same page or pass to controller. can me it?
thanks,
try (untested):
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 controller (mycontrollercontroller.cs
)
[httppost] public actionresult action(object[] divids=null) { //break here , view results of divids. return json("success"); }
Comments
Post a Comment