jquery - How to pass values from JSTree Menu to MVC controller -


i using example in -

http://codemyne.net/articles/populating-treeview-with-checkboxes-using-mvc3razor-jstree-jquery.aspx?visitid=149&type=2

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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -