Page 1 of 2

Listview weight

Posted: Sat May 28, 2016 6:18 am
by GMKai
Hello,

I have a listview with this defintion:

Code: Select all

<listview id="mainmatchforecast" autovisible="true" MultiSelect="None" input="false" frame="ReadList">
							    <column title="Week" weight="100"/>
							    <column title="Home" weight="1200"/>
							    <column title="Away" weight="1200"/>
</listview>
when filled,
it looks like this:
https://www.dropbox.com/s/b7o1i9ttshvzhw6/Grab.png?dl=0

When clicking "Größen zurücksetzen"(reset size) all is fine...how can this be achieved via code?

Re: Listview weight

Posted: Sat May 28, 2016 5:27 pm
by airsoftsoftwair
I'm not sure I understand what you want to do here but to reset a listview column's weight to the default value, you can just set Listviewcolumn.Weight to 100 which is the default:

Code: Select all

mui.Set("col1", "weight", 100)
mui.Set("col2", "weight", 100)
mui.Set("col3", "weight", 100)
But you need to give your columns ids first:

Code: Select all

...
    <column id="col1" title="Week" weight="100"/>
    <column id="col2" title="Home" weight="1200"/>
    <column id="col3" title="Away" weight="1200"/>
...

Re: Listview weight

Posted: Sun May 29, 2016 1:37 pm
by GMKai
Problem is,
the contents of the columns Home/Away is much broader than shown in screenshot.
When resizing the listview via menu, all is fine.
How can I force a redraw/resize after the listview got filled?

Re: Listview weight

Posted: Mon May 30, 2016 9:47 pm
by airsoftsoftwair
Problem is, the contents of the columns Home/Away is much broader than shown in screenshot.
Well, but that is what you're requesting when setting weight for "Home" and "Away" to 1200. This means that "Home" and "Away" should be TWELVE TIMES as wide as "Week" which only has a weight of 100. Is that really what you want?
How can I force a redraw/resize after the listview got filled?
That's normally not necessary because MUI will automatically adapt the column width to be large enough to show the longest text entry.

Re: Listview weight

Posted: Tue May 31, 2016 5:49 am
by GMKai
airsoftsoftwair wrote:
That's normally not necessary because MUI will automatically adapt the column width to be large enough to show the longest text entry.
Here the automagic mechanism is off, I have to resize manually to make the text fully visible.
I now have made a nesting group with samesize="false" but this was only an idea.
Is there something else to look at, when the listview is not good as it could be?

Re: Listview weight

Posted: Wed Jun 01, 2016 6:40 pm
by airsoftsoftwair
I still don't really understand what you're trying to achieve here... maybe you can post a short sample code that shows the problem?

Re: Listview weight

Posted: Thu Jun 02, 2016 9:34 pm
by GMKai
Problem is with the columns:
The text is cut off, e.g. it says "Frank" instead of "Frankfurter SV".
So for example for "Frankfurter SV" the first column is filled with "Frank" by default. The second column, which is defined exactly the same, the text only says "Fran".

The full text becomes visible when the window size is changed. Even minimizing the window is possible with my current state, but columns are not completly visible...
With shorter examples I only get working titles...
I even tried to close and reopen my window, but still no success...

Re: Listview weight

Posted: Fri Jun 03, 2016 10:27 pm
by airsoftsoftwair
If you leave out the "weight" in your listview declaration, MUI should always adapt the column size automatically... this should solve the problem. Just remove the "weight" attribute from all your listview columns.

Re: Listview weight

Posted: Sat Jun 04, 2016 8:02 am
by GMKai
leaving out "weight" does not change the behaviour...
and the columns "home" and "away" have different weight...
and resizing the window leads to a "good" layout...with columns fully visible...

before filling
calling mui.set("mainmatchforecast","Quiet",True)
or not calling,
does not change the result...

Re: Listview weight

Posted: Sat Jun 11, 2016 9:49 pm
by airsoftsoftwair
Please provide a VERY SHORT demo script and XML that shows what the problem is. I've tested MUI's behaviour here and it always adapts the column width to the width of the largest entry so I don't really know why this isn't working for you...