Lost Password
Create an Account

Your username must be unique, and cannot be changed later.

We use your email address to email you a secure password and verify your account.

Asyncpanels problem

HomeForumsWink uiAsyncpanels problem

This topic has 3 voices, contains 5 replies, and was last updated by  carsten89 319 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
July 5, 2012 at 7:13 am #link

Hi,
i’m total new here and i would do something link this:


<?php
foreach ($categories as $category){
echo "$category['name']";
}
?>

how could i combind this with Asyncpanels?

a second foreach wich generate this?


var asyncPanels;

	var properties =
	{
		'duration': 500,
		'pages':
		[
		 	'page_startmenu',
{id: 'page_shop_get_category', url: 'category/1'},
{id: 'page_shop_get_category', url: 'category/2'},
{id: 'page_shop_get_category', url: 'category/3'},
		 ]
	}
 	asyncPanels = new wink.plugins.AsyncPanels(properties);
        wink.byId('container').appendChild(asyncPanels.getDomNode());

thanks for your help

  • This reply was modified 325 days ago by  carsten89.
July 5, 2012 at 7:32 am #link

a second foreach wich generate this?

div id=”shop_get_category1″
div id=”shop_get_category2″
div id=”shop_get_category3″

  • This reply was modified 325 days ago by  carsten89.
  • This reply was modified 325 days ago by  carsten89.
July 5, 2012 at 8:03 am #link

Hi,

Yes, you can use a foreach loop to generate the divs where the content of your pages will be inserted. You can alos use a foreach loop to add the right properties to the asyncpanels.

Note that the ids you specify in the properties must be unique and correspond to the divs you created.

I hope this helps…

Jérôme

July 5, 2012 at 8:19 am #link

thanks for the fast answer.

but when i use a foreach i would have 50-100 divs on the site.

is there a more dynamical way?

July 10, 2012 at 12:35 pm #link

Hi,

If you’re talking about optimize the use of the asyncpanels component, there is currently no way to add or remove dynamically pages, you have to make your loop on the ‘pages’ property of the component.
Since the 1.4.2, you can add or remove pages on the slidingpanels component, on which the asyncpanels is based, so you may extend the asyncpanels in order to fit your needs with your own ‘add’ or ‘remove’ methods.

hope this helps

Sylvain

July 11, 2012 at 7:44 am #link

i have now write my own add and remove method and it works good for me.
thanks for help.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.