EasyUI Forum
September 13, 2025, 12:13:31 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Placing two treegrids alongside each other  (Read 11151 times)
alastairwalker
Newbie
*
Posts: 14


View Profile Email
« on: August 19, 2014, 06:11:59 AM »

I am trying to place two treegrids alongside each other.

I am using the following code:

Left table:

<table id="tg" title="Folder Browser 1" class="easyui-treegrid" style="width:50%;height:250px;align:left"
         data-options="
            data: data,
            rownumbers: true,
            idField: 'id',
            treeField: 'name',
            onLoadSuccess: function(row){
               $(this).treegrid('enableDnd', row?row.id:null);
            }
         ">
..
</table>

and

Right table:

<table id="tg2" title="Folder Browser 2" class="easyui-treegrid" style="width:50%;height:250px;align:right"
         data-options="
            data: data2,
            rownumbers: true,
            idField: 'id',
            treeField: 'name',
            onLoadSuccess: function(row){
               $(this).treegrid('enableDnd', row?row.id:null);
            }
         ">
..
</table>

The tables remain aligned vertically - the first above the second.

I suspect my codes for the left and right align are incorrect.

Is there a way to correctly specify the alignment so that the tables left and right align?

Many thanks,

Alastair
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: August 19, 2014, 07:00:34 PM »

No 'align' property is available in treegrid plugin. To solve this issue, you can declare two <div> elements and place the treegrid components to each of <div> elements.
Code:
<div style="width:49%;float:left">
<table class="easyui-treegrid" style="width:100%;height:250px">
...
</table>
</div>
<div style="width:49%;float:right">
<table class="easyui-treegrid" style="width:100%;height:250px">
...
</table>
</div>
Logged
alastairwalker
Newbie
*
Posts: 14


View Profile Email
« Reply #2 on: August 19, 2014, 10:50:43 PM »

I get it!

Thank you very much!

Alastair
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!