EasyUI Forum
May 01, 2024, 01:39:19 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] DataGrid "fit" does not work  (Read 8093 times)
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« on: August 23, 2016, 07:25:23 AM »

Hello
if I send datagrid into DIV and if datagrid have fit="true", datagrid is not displayed.
Please take a look here:
http://code.reloado.com/oeasyrik1/37/edit#preview
if you remove fit="true", datagrid is loaded.
With other words, how to "fit" datagrid after loading into DIV?
Thank you.
« Last Edit: August 23, 2016, 11:50:58 PM by Pierre » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: August 23, 2016, 07:59:15 AM »

Please notice that you haven't set the 'height' property for your div(div_table). This will make the datagrid to be zero height. The updated example below works well.
http://code.reloado.com/oeasyrik1/38/edit#preview
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #2 on: August 23, 2016, 10:16:08 AM »

Thank you but I don't know the height because DIV is declared inside layout, something like:

Code:
              <div class="easyui-layout" fit="true"> 
                  <div data-options="region:<39>west<39>,split:true" title="Title" style="width:500px" >
                     <div id="myTableDiv"></div>               
                  </div>
              </div>

Later I fill the "myTableDiv" with table. It works perfect when I declare table inside the layout, but when I use DIV and declare table later, "fit" does not work...
With other words, I never declare table height, I'm just use fit="true" but now I need to declare table later and I don't know how to declare table which will have same size as layout (table need to be also resized with layout).
Tahnk you.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: August 23, 2016, 06:58:01 PM »

You just need to set 'height:100%' for the datagrid container. Please look at this example http://code.reloado.com/oeasyrik1/39/edit
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #4 on: August 23, 2016, 11:50:42 PM »

Awesome, so simple solution, I should know ..  Angry
Thank you for your help Grin
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!