carousel and array []

who can say, how transfer data images to imageList and carousel slider i have this code

			gridc.attachEvent("onItemDblClick", function(id, e, node){
			var arr = $$('st').getSelectedId(true);
			var vItemid = $$('st').getText(arr[0], "id");
			
			webix.ajax().sync().get("server/photos.php", { itemid : vItemid }, 
			 function(text, data){
				webix.message({ type:"messeage", text:"Photo loaded",  expire:1000});
				jdata = data.json();
				images = [];
				viewsArray = [];			
				alert(text)
				for(var i = 0; i < jdata.length; i++){
					images.push(
					{id: i,
					src: '/photos/' + jdata[i].src,
					title: i
					});
					
					viewsArray.push({
					id: images[i].id,
					css: "image",
					template:img,
					data: webix.copy(images[i])
					});

				}
			});				
			
			$$("lotcart").clearAll();
			$$("lotcart").load("server/datatable.php?itemid="+vItemid);
			$$('popup').show();
			
			return false;
		});

and my image slide code

		{
			rows:[
			{
				view: "carousel",
				id: "carousel",
				height:225,
				width:350,
				cols: viewsArray,
				navigation: {
					type: "side",
					items: false
				}
			},
			
			{
				view: "dataview",
				id: "imageList",
				css: "nav_list",
				yCount: 3,
				select: true,
				scroll: true,
				type: {
					width: 41,
					height: 41
				},
				template: img,
				data: images
					},



				]

			},

my solution not work, i have some trouble help please.
data from photo i have in array .
but slide not show images…

In which moment you are creating the UI for the carousel ? If it occurs before ajax call, it will use empty viewsArray, not the one with data.

Thanks for the reply, I have a function called before the structure build UI, and after too

okey i’m mody a little my code and what i have now ,
images = [];
viewsArray = [];
for(var i = 0; i < jdata.length; i++){
images.push(
{id: i,
src: ‘/photos/’ + jdata[i].src,
title: i
});
images.push - put images in id: “imageList”, but carousel nothing show , i need help

The key point here is that you must have viewsArray filled with data before initing ui
Check the next sample
http://webix.com/snippet/bdc62de0
(its ugly, but shows that data loading works)

Hi, Viktor

I understand your explanation and snippet. But how would you advice to do it, if Carousel showed be populated dynamically (for example, when the form with Carousel is opened in OnDblClick event on some table row)?

I mean, when form with Carousel is opened no just one time, but is opened over and over again. How to load new set of images to Carousel?

Check the next sample
http://webix.com/snippet/94fe3949

Unfortunately for now, it is overcomplicated. In one of next build we will add some kind of data carousel component, which works with items similar to list and grid. So it will be possible to add, load, change, remove them through common data api.