View Full Version : dispalying the images in order
mallesh
12-03-2003, 02:49 AM
Hi Antun,
I want to dispaly the images in a view, the path for that images are from the dataset.That dataset contain path for more than 15 images, but i want to show only
3 images in a row. The fourth should go to the next row and so on.Right now i am getting the images, which are arranging in a single row.(with some non visible)
(using simple layout). and also i am setting the datapath of other view by using this view's datapath using "setDatapath method.
Thanks
Mallesh.
antun
12-03-2003, 08:17 AM
You're asking how to get replicated views to arrange themselves in rows? Use wrappinglayout. See this thread:
http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=411&highlight=wrappinglayout
-Antun
mallesh
12-08-2003, 06:04 AM
Hi Antun,
Thanks for reply it works fine now.
But the problem with that solution is that,it does not fit into the fixed height (also for fixed width),with all the items displayed well with in that view, with scroll bar for scrolling items.
I mean, if the number of item increase, it should accomadate all the item well with in that view that has fixed width and fixed height with scroll bar for scroll the item.
I hope you understand my problem.
here is the code for above problem.
<canvas debug="false">
<include href="utils/layouts/wrappinglayout.lzx" />
<dataset name="my_data" request="false" src="mydata.xml" type="http">
</dataset>
<simplelayout spacing="5" />
<button>
Do Request
<method event="onclick">
canvas.datasets.my_data.doRequest();
</method>
</button>
<class name="mywrappinglayout" extends="wrappinglayout">
<attribute name="animated" value="0" />
<method name="addSubView" args="v">
super.addSubView( v );
this.update();
</method>
</class>
<view bgcolor="0xe5e5e5" >
<view width="60" height="70" datapath="my_data:/items[1]">
<mywrappinglayout horz_spacing="5" vert_spacing="2"/>
<view bgcolor="0xffffff" width="25"
datapath="item">
<text datapath="@name" resize="true"/>
</view>
</view>
<scrollbar />
</view>
</canvas>
Thanks
Mallesh.
antun
12-08-2003, 11:31 AM
I'm not quite sure what you mean, but I think I'll be able to see what you mean if you send me the data file you're using.
-Antun
mallesh
12-08-2003, 08:16 PM
HI Antun,
below i am attaching the example code.
Here, the items are dispalying beyond the scrollbar
but that should not happen and all items should display inside the view that contain scroll bar.
Thanks
Mallesh.
antun
12-09-2003, 08:25 AM
I see now. Use the clip attribute of a view to clip its contents that are outside of the defined size:
<canvas debug="false">
<include href="utils/layouts/wrappinglayout.lzx" />
<dataset name="my_data" request="false" src="mydata.xml" type="http">
</dataset>
<simplelayout spacing="5" />
<button>
Do Request
<method event="onclick">
canvas.datasets.my_data.doRequest();
</method>
</button>
<class name="mywrappinglayout" extends="wrappinglayout">
<attribute name="animated" value="0" />
<method name="addSubView" args="v">
super.addSubView( v );
this.update();
</method>
</class>
<view bgcolor="0xe5e5e5" clip="true">
<view width="60" height="70" datapath="my_data:/items[1]">
<mywrappinglayout horz_spacing="5" vert_spacing="2"/>
<view bgcolor="0xffffff" width="25"
datapath="item">
<text datapath="@name" resize="true"/>
</view>
</view>
<scrollbar />
</view>
</canvas>
-Antun
mallesh
12-10-2003, 04:16 AM
HI Antun,
When i use clip="true", it clip the view to the specified height, and it shows only some of the itmes but remaining items are not visible.
But i want all the items should visible by scrolling the scroll bar.
Thanks
Mallesh.
antun
12-10-2003, 08:07 AM
That's because you're setting the height of the unnamed view with datapath "my_data:/items[1]". You need to set the height of the view (its parent) that will do the clipping:
<view bgcolor="0xe5e5e5" clip="true" height="70">
<view width="60" datapath="my_data:/items[1]">
-Antun
mallesh
12-10-2003, 09:18 PM
Hi antun,
Now it is working fine.
Thanks alot
Mallesh
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.