jstree

jsTree, JSON and MVC3 objects. How to structure data

梦想与她 提交于 2019-12-12 03:21:46
问题 I have been playing with JsTree a little and MVC3. I can successfully call MVC3 methods and get back JSON to load a basic JsTree so i can do the very basics. What i don't understand is the more complicated data structure to use mostly to do wait extra data i need on nodes and also getting the tree to act on some of that data. My data is NodeText (string) - text to display ItemStatus (enum) - Used to set colors etc on tree ItemType (enum) - controls what can be dragged and dropped and onto

ivh tree - disable node for selection

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:18:45
问题 I am new to ivh tree (https://github.com/iVantage/angular-ivh-treeview) and using this library. I want to disable to certain nodes for selection, based on user entitlement for example i have tree like this $scope.bag = [{ label: 'Glasses', value: 'glasses', entitled: false, children: [{ label: 'Top Hat', value: 'top_hat', entitled: true }, { label: 'Curly Mustache', value: 'mustachio', entitled: false }] }]; }; So based on variable entitled: [boolean], it should let user select or unselect.

How can I initialize jsTree on a dynamically loaded ASP.NET MVC Partial View that is called via an Ajax.ActionLink

倖福魔咒の 提交于 2019-12-12 03:08:06
问题 I want to create an ASP.NET MVC 5 application that uses jsTree (http://www.jstree.com). I am using ASP.NET AJAX to dynamically load a page during runtime. Where can I initialize jsTree on the dynamically loaded partial view? When I start the web application everything is ok. I see the tree like this: But now I click on 'Change Tree View' and a partial view is loaded via an Ajax.ActionLink. Now the tree will not be rendered as a TreeView but only as a normal list: You can initialize the tree

building jstree menu based on xml

☆樱花仙子☆ 提交于 2019-12-12 00:19:02
问题 I am trying to build the jstree menue based on xml file. My code is this: $("#div").jstree({ "xml_data" : { "ajax" : { //"url": "jstree.xml" "url": "http://192.168.101.1/xml/jstree.xml" }, "xsl" : "nest" }, "plugins" : ["themes", "xml_data", "ui","types"] When the file is local as stated above followed by //, it works. If I tried to access the xml file via http call, it does not work. Any ideas? I really like to call the xml file via http since the file will be updating all the time. 回答1:

Access TypeScript functions from JavaScript

寵の児 提交于 2019-12-11 19:39:28
问题 I want to use TypeScript with jsTree. How can I call the setCurrentNode function in the bound jsTree function? class MyController { thescope: any; static $inject = ['$scope']; constructor($scope) { $scope.vm = this; this.thescope = $scope; (<any>$("#demo2")).jstree({ .bind("select_node.jstree", function (e, data) { // how can I call setCurrentNode(data) here? } }); } setCurrentNode(node: any): any { ... // do Stuff in this typescript function } } 回答1: Solution: (<any>$("#demo2")).jstree({

How to load jstree checkbox on load VB ASP

浪尽此生 提交于 2019-12-11 13:37:15
问题 I'm trying to load jstree checkboxes on load using ASP. The code behind takes a tree node and populates a list item for the jstree to use. In this process, there are nodes that are identified as "Checked", in which I add the class attribute jstree-clicked to the list item. However when the page loads, it doesn't have any effect. Please let me know what to the appropriate way to populate these check boxes with the check boxes pre-checked. I have the following in my back end Protected Sub Page

" is JSON string

非 Y 不嫁゛ 提交于 2019-12-11 11:28:39
问题 I have a JSON string which looks like this when displayed in an ASP.NET MVC page using @Model.JsonData [ { "id": 123, "text": "Consumer", "parent": "#"; } ] When I use the same @Model.JsonData in the JavaScript code it is encoded as: [ { "id": 123, "text": "Consumer", "parent": "#" } ] Why does the JavaScript segment encode the double quotes? When the double quotes are encoded the jstree plugin expecting JSON data does not work. <script> $(function () { $('#jstree').jstree({ 'core': { 'data':

can we go one level up node using jquery?

无人久伴 提交于 2019-12-11 11:05:23
问题 I make a demo of tree view using jstree .I am able to move next and previous element selectable. Ecample Click "b" now it is selectable and then press next and previous it it move active class. Can we go one level up using "one level up button" when user selects "b-a" and when user clicks next it comes to "b-b" and previous it come to "b-a". It never goes one level up can we go one level up using "one level up button" then it goes to "b" http://jsfiddle.net/fuu94/60/ $('#next').click(function

How to change position of node on button click using jstree?

为君一笑 提交于 2019-12-11 08:57:07
问题 Can you please tell me is there any way to change the position of node on button click.actually I am using jstree in my demo.I read all API http://www.jstree.com/api/ I didn't find any way to change the position of node on button click. In my demo "b" node on second position. Can we change the position of node on button click .it ("b" node)will come on "first" and "a" node come on second. http://jsfiddle.net/fuu94/185/ $(document).ready(function() { $('#tree').jstree({ core: { check_callback:

How to get partially selected parent id in jstree

戏子无情 提交于 2019-12-11 07:38:02
问题 I am using "jstree" for treeview (Parent-Child) structure uisng checkboxes and returning id for each selected item. But here I am getting only children's Id and not getting selected parent Id. Kindly help me to get it too. click [ enter code here http://jsfiddle.net/2kwkh2uL/5807/ ]to find the code. 回答1: Each object carries a key called parent , this contains the id . The answer below: $('#container').jstree({ 'core' : { 'data' : [ { "text" : "P1", "children" : [ { "text" : "O11" }, { "text"