Comments (9)
Sounds like a bug. I will look into it.
from jqtree.
I cannot reproduce the error.
Do you use 'getselectednode' or 'getSelectedNode'?
from jqtree.
this is my code :
function OnStartPage() {
var mydiv = $("#mydiv");
$.getJSON(
"mypage.aspx",
function (data) {
if ("" == mydiv[0].innerHTML) {
mydiv.tree({
data: data,
autoOpen: false,
dragAndDrop: false,
selectable: true,
saveState: "mytreeview"
});
}
else {
mydiv.tree('loadData', data);
}
}
);
var node = mydiv.tree('getselectednode');
// result : node is null
}
from jqtree.
I think you should call 'getSelectedNode' after loading the data. Like this:
$.getJSON(
"mypage.aspx",
function (data) {
if ("" == mydiv[0].innerHTML) {
mydiv.tree({
data: data,
autoOpen: false,
dragAndDrop: false,
selectable: true,
saveState: "mytreeview"
});
}
else {
mydiv.tree('loadData', data);
}
var node = mydiv.tree('getSelectedNode');
}
);
I hope this works.
from jqtree.
i tried but node is still null.
from jqtree.
it work with 'getSelectedNode'
from jqtree.
I also got problem with 'getSelectedNode' . It returns "false" for the first time of select. But what I prefer is i want to get the node that i select. Any help?
from jqtree.
Hello Limmouyleng,
In which situation exactly does getSelectedNode
return false? Are you using the saveState
option or are you selecting a node by clicking on it?
Greetings
from jqtree.
Hi mbraak,
I solved this problem by using " $(document).delegate('#tree', 'click', function() {}) " . But the previous problem is when i used "onclick in
from jqtree.
Related Issues (20)
- Question: Is there a way to know when dragging a node if it's dropped at its same place before dragging or not? HOT 4
- Issue while trying to load a little bit large amount of nodes HOT 1
- Disable opening folders during drag & drop HOT 5
- Selected Node Problem HOT 2
- Possible to open a particular node at jqTree creation time? HOT 1
- Cannot find node with getNodeById HOT 12
- Functions getNextNode() and getPreviousNode() operate differently based on whether node is open or closed HOT 4
- Question: Is is possible to find a node using its path? HOT 1
- What can I do if I choose only child multiple times HOT 6
- How to export and import jqTree data? HOT 9
- Rename selected node HOT 3
- Autoscroll - top level dragged item no scroll over the items under it. HOT 20
- Feature: ES6 support HOT 9
- Behavior changed with 1.7.0 HOT 3
- Set jQuery as a peer dependency
- Fix eslint import error
- Is documentation page dead? HOT 4
- Inconsistent/incorrect drag & drop node highlighting HOT 9
- New root node missing icon HOT 3
- AddToSelection doesn't seem to use "mustSetFocus" HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jqtree.