I use this to find out what checkbox are selected.
var array_nodes = [];
// loop through each checked
$("#categories-container").jstree("get_checked").each(function(key,
value){
// get id
var current_id = getId($(value).attr("id"));
if (current_id) {
// main node
array_nodes.push('ids[]='+current_id);
}
});
for the current one I think you can do
data.rslt.attr("id")
On Aug 6, 12:09 am, Alex <
a...@heaton.me> wrote:
> From that 'check_node' event that gets fired, how can you dig down and
> find out which nodes are being selected?
>
> I'd like to have an event that fires on each leaf node, whenever it is
> selected, but can't seem to work out how.
>
> Any ideas?
>
> Alex
>
> On Aug 5, 2:57 pm, Kheang <
k...@simplecommerce.com> wrote:
>
>
>
> > Hi Ivan,
>
> > I have noticed something else while doing a test.
> > When my XML tree is loaded and the first parent node in the tree is
> > "checked" it triggers a "change_state".
> > So if I put a function call to save the node beingcheckedor
> > unchecked, everytime I check the very first item on my tree, it always
> > unchecks it everytime since it triggers a change_state as soon as it's
> >checkedand refreshed.
>
> > What I was experimenting with was to be able to save acheckedor
> > uncheck node on change_state, but then I noticed this.
> > Is this normal?
>
> > Thanks!
>
> > On Aug 4, 3:16 pm, Kheang <
k...@simplecommerce.com> wrote:
>
> > > Hi,
>
> > > I just noticed that if I have a parent node with child nodes and I add
> > > the class "jstree-checked" on the main node, it doesn't seem to want
> > > to check it by default.
> > > Is there a reason why?
> > > Do I need to check all the child nodes in order to get the parent one
> > >checked?
>
> > > I am using XML flat file method and it was simple for me to simply add
> > > the class "jstree-checked" to the ones that arechecked.
>
> > > It currently works when I select a few of the child nodes of that
> > > parent.
> > > But when I select the parent it returns me the id of the parent, which
> > > is ok for me since that's what I need.
> > > But it doesn't seem to check it.
>
> > > On Jul 30, 9:38 am, vakata <
ivan.bozha...@gmail.com> wrote:
>
> > > > The thing about parent nodes was in the get_ functions - they used to
> > > > return onlycheckednodes - if a parent had three children and all are
> > > > > > > nodes that arecheckedand loop through that and check them after the