0

how fill entire grid row height

asked 2012-03-20 09:26:44 +0800

khcyt gravatar image khcyt
216 1 1

Hello,

how can I achieve it that the text field always takes the entire row height. Currently the textbox only fills a portion of the row.
Press the button, to see the various behavior. I have tested it with ZK 6.

Thanks in advance
Kai

<zk>
	<zscript>
	ListModelList values= new ListModelList(new Integer[] { 0});
	
	void add_row(Component grid)
	{
		values.add(new Integer(values.size()));
		g.getFellow("c").invalidate();
	}
	</zscript>
	<grid id="g">
		<rows>
			<row>
				<cell hflex="true">
					<listbox model="${values}">
						<template name="model">
							<listitem>
								<listcell>Label ${each+ 1}</listcell>
								<listcell><textbox hflex="1" rows="3"></textbox></listcell>
								<listcell>
									<button label="Add row">
										<attribute name="onClick"><![CDATA[add_row(g);self.setVisible(false);]]></attribute>
									</button>
								</listcell>
							</listitem>				
						</template>
					</listbox>
				</cell>
				<cell id="c" hflex="1" vflex="true">
					<textbox hflex="1" vflex="1" multiline="true"></textbox>
				</cell>
			</row>
		</rows>
	</grid>
</zk>

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2012-03-21 02:30:18 +0800

hawk gravatar image hawk
3073 1 5
http://hawkphoenix.blogsp... ZK Team

Hi,
render entire row to solve this issue.

	void add_row(Component grid)
	{
		...
		g.getFellow("r").invalidate();
	}
	</zscript>

<row id="r" vflex="true">
...
</row>

link publish delete flag offensive edit

answered 2012-03-21 07:22:46 +0800

khcyt gravatar image khcyt
216 1 1

This is good. I thank you for the tip.

Kai

link publish delete flag offensive edit

answered 2015-01-13 10:22:11 +0800

khcyt gravatar image khcyt
216 1 1

Hi Hawk,

I must come back to my earlier question. If I specify the attribute "sizedByContent" to true, the width of the column 0 in the version ZK 7.0.4 will probably miscalculated after invalidate(). I know that I not have full control as soon as "sizedByContent" is set to true. With ZK version 6.5 the column width was as expected (if <column> element is removed, then however, the width was not as expected too).

Thanks in advance Kai

<?xml version="1.0" encoding="UTF-8"?><zk>
<zscript>
ListModelList values= new ListModelList(new Integer[] { 0 });

void add_row(Component grid)
{
    values.add(new Integer(values.size()));
    g.getFellow("r").invalidate();
}
</zscript>
<grid id="g" sizedByContent="true">
    <columns id="cols"  width="100%">
        <column hflex="1" align="left"/>
        <column hflex="1" align="left"/>
    </columns>
    <rows>
        <row id="r">
            <cell hflex="1">
                <listbox model="${values}">
                    <template name="model">
                        <listitem>
                            <listcell>Label ${each+ 1}</listcell>
                            <listcell><textbox hflex="1" rows="3"></textbox></listcell>
                            <listcell>
                                <button label="Add row">
                                    <attribute name="onClick"><![CDATA[add_row(g);self.setVisible(false);]]></attribute>
                                </button>
                            </listcell>
                        </listitem>             
                    </template>
                </listbox>
            </cell>
            <cell hflex="1">
                <textbox hflex="1" vflex="1" multiline="true"></textbox>
            </cell>
        </row>
    </rows>
</grid></zk>
link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-03-20 09:26:44 +0800

Seen: 188 times

Last updated: Jan 13 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More