EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: korenanzo on June 24, 2016, 07:05:05 AM



Title: how to set data grid rows height
Post by: korenanzo 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


Title: Re: how to set data grid rows height
Post by: stworthy 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');


Title: Re: how to set data grid rows height
Post by: peter900 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.   



Title: Re: how to set data grid rows height
Post by: stworthy 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');
}