<div id="jstree_demo_div"></div>
<script type="text/javascript">
$("#jstree_demo_div").on("select_node.jstree",
function (evt, data) {
var t = data.node.text;
}
);
});
$(function () {
$(".textbox").click(function (e) {
var thisID = $(e.target).attr("ID");
var csID = thisID.substr(thisID.lastIndexOf("_") + 1);
$('#posDetailDiv').hide();
var line = $('#dlLine').val();
showtree1(csID, line);
});
});
function showtree1(thisID, line) {
$('#jstree_demo_div').jstree({
"core": {
"data": //data - jquery
{
type: "POST"
, dataType: "json"
, contentType: "application/json; charset=utf-8"
, url: "DummyPage.aspx/populateTree"
, data: JSON.stringify({ imgID: thisID, line: line })
, success: function (node) {
var ReturnString = node.d;
alert(ReturnString);
return { "id": node.id };
}///success
, error: function (msg) {
alert("Error: " + msg.responseText);
}///error
}//data
}///core
,
"plugins": ["themes", "json_data", "search", "contextmenu", "types"]
});
}
</script>
[
{ \"id\":1,\"text\":\"Customer Projects\",\"children\":
[
{\"id\":2,\"text\":\"Doors\"},
{\"id\":3,\"text\":\"Lighting\"},
{\"id\":4,\"text\":\"Carpet\"},
{\"id\":5,\"text\":\"Electrical\"}
]}
]
"[from
]
]},
...
--
You received this message because you are subscribed to a topic in the Google Groups "jsTree" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jstree/BbBe5Zwb7Yo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jstree+un...@googlegroups.com.
To post to this group, send email to jst...@googlegroups.com.
Visit this group at http://groups.google.com/group/jstree.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to jstree+unsubscribe@googlegroups.com.
$(
'#jstree_demo_div').jstree({ "core": { "data": //data - jquery{
type:
"POST", dataType:
"json", contentType:
"application/json; charset=utf-8", url:
, data: JSON.stringify({ imgID: thisID, line: line })
, success:
function (node) { var ReturnString = node.d;}
///success
, error:
function (msg) {alert(
"Error: " + msg.responseText);}
///error}
//data}
///core,
"plugins": ["themes", "json_data", "search", "contextmenu", "types"]});
To unsubscribe from this group and all its topics, send an email to jstree+un...@googlegroups.com.
, data: JSON.stringify({ imgID: 541, line: 278 })
[
WebMethod] public static string populateTree(string imgID, string line){
DAL_Flow DL = new DAL_Flow(); string nodevalues = DL.JsonNav(imgID, line); return nodevalues;}
Hi Ivan
To unsubscribe from this group and all its topics, send an email to jstree+unsubscribe@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to jstree+un...@googlegroups.com.
I hope this helps. Maybe I'm going at this all wrong which I wouldn't be surprised. This is my first crack at jquery. It's looks great, but wouldn't surprise me if I'm trying to do something jstree isn't meant for. But usually I get creative on things and I can figure it out. For some reason, I'm just really stumped. I understand what's happening but I can't find a solution b/c I don't know all the syntax and process flow of it.This returns a unique navigational menu that is mostly informational but does have some links to articles as you drill down.I'm sorry - I'm probably not being real clear on the purpose...So, I have a bunch of text boxes that are dynamically generated that hold different values. The tree provides different information based on what box is clicked.
So, for example, the whole page has a line number and based on that line number, a grid of boxes is generated. Each box has its own value associated with the line number. So, for example, line 10 might have 25 boxes with values 25-50 and line 1 might have 10 boxes with values 1 through 10. (this is a real generic example but hopefully gives you the idea).
If box 1 is clicked, the .click event passes the line number value and the box value to a webmethod that calls a stored procedure in SQL.
This whole tree navigation is different for each line number and box value. So, I have to repopulated it each time. It's not the same for the page. It's actually at the object level of the page.
To unsubscribe from this group and all its topics, send an email to jstree+un...@googlegroups.com.