EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: pmjenn on August 20, 2014, 07:04:14 AM



Title: Minimum Row Height for Datagrid
Post by: pmjenn on August 20, 2014, 07:04:14 AM
Datagrid (and Treegrid) work better on a mobile device when the row height is big enough to give a good landing zone for touch. Is there are way to set a minimum row height for rows in a datagrid?


Title: Re: Minimum Row Height for Datagrid
Post by: stworthy on August 20, 2014, 07:58:48 AM
Please try to set the following CSS style.
Code:
<style>
.datagrid-header-row, .datagrid-row{
height:30px;
}
</style>


Title: Re: Minimum Row Height for Datagrid
Post by: pratikk on January 05, 2016, 10:53:24 AM
How can we do this with code

I tried ;

$('.datagrid-row').css({'height', '50px'});

But It didn't work.

I am writing  a touch screen app. so This will be very useful. 
Another thing is  combogrid is getting the new height but combo box don't .


Title: Re: Minimum Row Height for Datagrid
Post by: stworthy on January 05, 2016, 08:39:43 PM
Please try this code instead.
Code:
$('#dg').datagrid({
    onLoadSuccess: function(){
        $(this).datagrid('getPanel').find('.datagrid-row').css('height', '50px')
    }
});


Title: Re: Minimum Row Height for Datagrid
Post by: pratikk on January 07, 2016, 06:28:42 AM
Thank You .  This is working nice with datagrid. I also want to adjust the combogrid and combobox  .  I tried this for combogrid but didn't worked.

                $('#cg_').combogrid({
                    onLoadSuccess: function(){
                        $(this).combogrid('getPanel').find('.datagrid-row').css('height', '50px');
                    }
                });


Title: Re: Minimum Row Height for Datagrid
Post by: stworthy on January 07, 2016, 08:25:24 AM
Please try this:
Code:
$('#cc').combogrid({
autoRowHeight: false,
onLoadSuccess: function(){
$(this).combogrid('grid').datagrid('getPanel').find('.datagrid-row').css('height','50px');
}
})

Why don't you use the '.datagrid-row' CSS style. It is more easier to change the datagrid row height.



Title: Re: Minimum Row Height for Datagrid
Post by: pratikk on January 07, 2016, 10:47:27 AM
I want to give the size parametric. So the users can change the height as up to their choice.

combogrid is working fine. Now on combobox

 $('#cb_onodetip').combobox(
                    {
                        autoRowHeight: false,
                        onLoadSuccess: function() {
                            $(this).combobox('grid').datagrid('getPanel').find('.datagrid-row').css('height', '50px');
                        }
                    });

I used the code above but it didn't work :(


Title: Re: Minimum Row Height for Datagrid
Post by: stworthy on January 07, 2016, 07:05:37 PM
Please try this code instead.
Code:
$('#cb_onodetip').combobox({
onLoadSuccess: function(){
$(this).combobox('panel').find('.combobox-item').css({
lineHeight: '50px'
})
}
});


Title: Re: Minimum Row Height for Datagrid
Post by: pratikk on January 07, 2016, 11:50:15 PM
Thanx. Now it is working