jquery - How do i prevent jsTree from expanding table cell? -


i creating jstree inside table cell.

the tree without expanding looks this:

enter image description here

but when click on root node . expands table cell.

enter image description here

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:

enter image description here

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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -