EasyUI Forum
September 14, 2025, 12:18:05 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: how to set data grid rows height  (Read 10817 times)
korenanzo
Guest
« on: June 24, 2016, 07:05:05 AM »

Hi,
I need to setup at runtime the height of a specific data grid rows.

I've seen how to do it for a specific single row:

Code:
var tr = dg.datagrid('options').finder.getTr(dg[0], index);
tr.css('height','100px')

but I need to size the whole table: I don't see a property  to do this.

 thanks,

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


View Profile Email
« Reply #1 on: June 24, 2016, 08:13:53 PM »

Please run this code to set the height for all rows.
Code:
var dg = ...
var opts = $(dg).datagrid('options');
opts.finder.getTr(dg[0], -1, 'allbody').css('height', '100px');
Logged
peter900
Newbie
*
Posts: 22


View Profile Email
« Reply #2 on: June 25, 2016, 04:05:36 AM »

I tried this code as row height setting was also on my list. 

I assumed dg represents the datagrid class i.e   var dg = '#dg';  but this code fails.   

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


View Profile Email
« Reply #3 on: June 25, 2016, 04:38:15 PM »

This code must be called on existing rows. Place it in 'onLoadSuccess' event.
Code:
onLoadSuccess:function(){
var dg = $(this);
var opts = $(dg).datagrid('options');
opts.finder.getTr(dg[0], -1, 'allbody').css('height', '100px');
}
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!