EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on February 29, 2016, 03:11:48 AM



Title: Ignore a Single Datagrid Column Height During Resize
Post by: devnull on February 29, 2016, 03:11:48 AM
I've tried to play with the CSS to achieve this but I cannot, and not really sure how to about this using JS.

I have a datagrid with cells that contains lists (UL/LI) and one of the columns (in the frozen columns) has up to 10 times more items than any other column in the unfrozen columns.

I would like to ignore a specific column when doing a resize, such that this column has it's overflow property set to scroll and the row is resized to match the next tallest cell.

Can this be done ?

Many thanks



Title: Re: Ignore a Single Datagrid Column Height During Resize
Post by: stworthy on February 29, 2016, 08:31:49 PM
You can try to use the 'formatter' function to limit the max height on a specified column.
Code:
formatter: function(value){
  return '<div style="max-height:60px;overflow:auto">'+value+'</div>'
}


Title: Re: Ignore a Single Datagrid Column Height During Resize
Post by: devnull on February 29, 2016, 08:33:22 PM
OOh, that's a good idea, I will try that


Title: Re: Ignore a Single Datagrid Column Height During Resize
Post by: devnull on March 02, 2016, 04:24:11 AM
Is there an event that fires once all of the rows have completed rendering, with a large table document.ready does not catch it ??

There is a resize() method, is there an event available from this once it is completed ?

I need to set a column's max-height after all of the rows have been rendered, if I try and do in onLoadSuccess() then all of the rows are set to their nominal size 25px. Even with a 250ms delay the rows are still not rendered, but this is a very large datagrid that is populated via JSON and the only reliable method would be some eventh that fies once the resize() has completed.

I have also tried on resize(), but that only fires on panel resize, not on datagrid resize (do layout, size)

Code:
      $.each($('ul.ulbar.unp'),function(){
        var row = $(this).closest('tr.datagrid-row');
        $(this).css('max-height',row.height());
      })