Note that there are some explanatory texts on larger screens.

plurals
  1. POJsTree .get_checked function doesn't work... help....?
    primarykey
    data
    text
    <p>I'm using JSTree and checkbox plugin, but I couldn't managed to pick the nodes selected (checked), I read in the JSTree documentation about the event .get_checked, but do not know how to implement it, neither the place to put it, if within the function where data is loaded or not, also I don't understand that when the event works, ie I do not know if the event is executed each time a node is checked or have an array that is filled every time a node is chcked... please help me ... the truth I'm lost and do not know how to do that.</p> <p>Here's my Jscript code, the load of data is fine, but the get_checked function doesn't work...</p> <pre><code>$(function () { $("#demo2") .jstree({ plugins: ["themes", "json_data", "checkbox", "crrm"], "json_data": { "ajax": { "type": "POST", "url": "/Ubicacion/Arbol/", "data": function (n) { return { id: n.attr ? n.attr("id") : 0} } } } }) .bind("check_node.jstree", function (event, data) { alert($.jstree._focused().get_checked().attr('id')); }) }); </code></pre> <p>Searching around internet I found a "middle" solution:</p> <pre><code> $(function () { $("#demo2") .jstree({ plugins: ["themes", "json_data", "checkbox", "crrm"], "json_data": { "ajax": { "type": "POST", "url": "/Ubicacion/GetTreeview/", "data": function (n) { return { id: n.attr ? n.attr("id") : 0} } } } }).bind('check_node.jstree', function (e, data) { alert("Nodo elegido " + data.rslt.obj.attr("id")); }); }); </code></pre> <p>I add these lines: </p> <pre><code>.bind('check_node.jstree', function (e, data) { alert("Nodo elegido " + data.rslt.obj.attr("id")); }); </code></pre> <p>and now I had only the parent node, the children doesn't be coleected... any idea..??</p> <p>please... help me...!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload