`
eimhee
  • 浏览: 2112281 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Last column to auto-adjust - Ext JS

阅读更多
I can't see that this is currently possible, so please enlighten me if you know the answer:

I have a grid in a GridPanel where I wan't the last column to always fill up the rest (the 'whitespace' to the right of the grid) if the total width of the columns is not as wide as the GridPanel itself.

How to do this... if it can be done?
Reply With Quote
  #2  
Old 03-02-2007, 10:35 AM
Default

It will involve some calculations, to do it efficiently it should be handled internally. I will look into it.
Reply With Quote
  #3  
Old 03-02-2007, 12:29 PM
Default

Quote:
Originally Posted by jacksloc
It will involve some calculations, to do it efficiently it should be handled internally. I will look into it.
Hey Jack... I would like to have such a function too.

Thanks again for your job.
Reply With Quote
  #4  
Old 03-02-2007, 01:16 PM
Default

For the domino developers out there, this would also be nice since Domino has a setting for 'views' (that we are displaying in the grid) to 'extend last column to window width'. I personally, would prefer if there were a way to pick *any* column as the one to grow/shrink automatically. Or (and maybe you already have this), you could have a minWidth and maxWidth and the grid will auto resize columns based off of these as well. Maybe the grid could even have a setting for minHeight and maxHeight for rows.
Reply With Quote
  #5  
Old 03-02-2007, 02:43 PM
Default

Quote:
Originally Posted by jacksloc
It will involve some calculations, to do it efficiently it should be handled internally. I will look into it.
Thanks Jack... it would be really nice!
Reply With Quote
  #6  
Old 03-02-2007, 02:48 PM
Default

I'd have to second that the "extend last column to window width" would be much better if it defaulted to the last column, but could be configurable.
Reply With Quote
  #7  
Old 03-03-2007, 08:06 PM
Default

Quote:
Originally Posted by JeffHowden
I'd have to second that the "extend last column to window width" would be much better if it defaulted to the last column, but could be configurable.
I would 2nd this, too.
Reply With Quote
  #8  
Old 03-04-2007, 04:54 AM
Default

Ok, I added it.

autoExpandColumn config option, that will need to be the id of a column in your column model. It doesn't default to the last column, you will need to specify a valid id. We just eliminated column order dependencies and I don't want to introduce a new one.

Some limitations (aka features):

It only grows, and doesn't shrink. Shrinking could be put in, but it will result in more calculation (not code wise, performance wise). I wouldn't recommend it, but I could add it.

A column auto expand (or shrink) has the overhead of a double layout but is still 5-10x faster than an autoSizeColumns call.

Once the user has resized any column, auto expand is turned off. If not, all kinds of undesirable behavior happens (e.g. user resizes any column smaller and it auto pops back to where it was ).
Reply With Quote
  #9  
Old 03-04-2007, 04:59 AM
Default

Thank you Jack... You are always the best.
Reply With Quote
  #10  
Old 03-04-2007, 01:47 PM
Default

Quote:
Originally Posted by jacksloc
Ok, I added it.
Thank you, Jack!

Quote:
Originally Posted by jacksloc
autoExpandColumn config option, that will need to be the id of a column in your column model. It doesn't default to the last column, you will need to specify a valid id. We just eliminated column order dependencies and I don't want to introduce a new one.
Sounds reasonable!

Quote:
Originally Posted by jacksloc
Some limitations (aka features):

It only grows, and doesn't shrink. Shrinking could be put in, but it will result in more calculation (not code wise, performance wise). I wouldn't recommend it, but I could add it.

A column auto expand (or shrink) has the overhead of a double layout but is still 5-10x faster than an autoSizeColumns call.

Once the user has resized any column, auto expand is turned off. If not, all kinds of undesirable behavior happens (e.g. user resizes any column smaller and it auto pops back to where it was ).
Okay. I will try to see if we can use this... well... of course we can... it's just that I think of the last columns in my layout that is currently hidden... if the users unhide these then I will try to find a way to make the last newly unhidden column the auto-resize-to-the-rest column instead.
Reply With Quote
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics