jquery - How do i prevent jsTree from expanding table cell? -
i creating jstree inside table cell.
the tree without expanding looks this:
but when click on root node . expands table cell.
i want table cell should not expanded.
my code follows:
<table border="1" cellpadding="0"cellspacing="0" width="100%" style="margin-top:10px;"> <tr> <td style="padding-left:5px;">pca</td> <td id="population"></td> <td id="sex"></td> <td id="literacy"></td> </tr> </table> <script type="text/javascript"> $(function () { $("#population").jstree({ "html_data" : { "data" : "<?php echo $populationdata;?>" }, "plugins" : [ "themes", "html_data","ui","checkbox" ] }); $("#sex").jstree({ "html_data" : { "data" : "<?php echo $sexdata;?>" }, "plugins" : [ "themes", "html_data","ui","checkbox" ] }); $("#literacy").jstree({ "html_data" : { "data" : "<?php echo $literacydata;?>" }, "plugins" : [ "themes", "html_data","ui","checkbox" ] }); }); </script>
i thought use overlay method have made following changes
<table border="1" cellpadding="0"cellspacing="0" width="100%" style="margin-top:10px;"> <tr> <td style="padding-left:5px;">pca</td> <td><div id ="overlay"><div id="population"></div></div></td> <td><div id ="overlay"><div id="sex"></div></div></td> <td><div id ="overlay"><div id="literacy"></div></div></td> </tr> </table> #overlay { position: fixed; z-index: 10000; }
but tree looks this:
how resolve issue?
to prevent table cell expanding need apply style
attribute div
containing jstree
.
now table
<div id ="overlay"><div id="population" style="overflow:auto;">
this prevent table cell expanding, provides scroll bar if space insufficient.
Comments
Post a Comment