Page 1 of 1

scroller and db

Posted: Fri Jun 14, 2013 8:08 pm
by Michael4771079

Hi Marina,
I have a group scroller, heres a s/s

Image

this is the code (kindly supplied by Joe) is on page load and popsup when textinput is clicked.

code< 21 ; i++) whl3 = ""+i;

var newwhl = JSON.stringify(whl3);

$(function(){

var whl2 = {'Car-Parts':'Car Parts',
'Car-Engines':'Car Engines',
'Mixed-Load':'Mixed Load',
'Other':'Other'};

var wheel = [{},{},{}];

wheel[0]['#Items'] = whl3;
wheel[2]['#Load'] = whl2;
wheel[1]['Packaged'] = whl1;
$('#j_16').scroller({ // ,
wheels: wheel,
height: 25
});
}); code

I dont know if its possiblle but can we populate these scrollers from db.

thx/code/code


scroller and db

Posted: Fri Jun 14, 2013 8:24 pm
by Michael4771079

Sorry Marina,
code didn't paste properly, this is the code

codevar whl1 = { "Apples": "Apples", "Oranges": "Oranges", "Pears": "Pears", "Lime": "Lime", "Lemon":"Lemon" };

var whl3 = {};
for(var i = 1 ; i < 21 ; i++) whl3 = ""+i;

var newwhl = JSON&#46;stringify(whl3);

$(function(){

var whl2 = {'Car-Parts':'Car Parts',
'Car-Engines':'Car Engines',
'Mixed-Load':'Mixed Load',
'Other':'Other'};

var wheel = [{},{},{}];

wheel[0]['#Items'] = whl3;
wheel[2]['#Load'] = whl2;
wheel[1]['Packaged'] = whl1;
$('#j_16')&#46;scroller({ &#47;&#47; ,
wheels: wheel,
height: 25
});
}); /code


scroller and db

Posted: Fri Jun 14, 2013 9:12 pm
by Maryna Brodina

Could you clarify please what do you mean on "populate these scrollers from db"? Do you mean values for whl1,whl2,whl3?


scroller and db

Posted: Fri Jun 14, 2013 9:19 pm
by Michael4771079

Yes exactly Marina,
although the values of each wheel would have relationships with the others,
for eg zip code, town, company name


scroller and db

Posted: Mon Jun 17, 2013 7:20 am
by Maryna Brodina

Hello! To get values whl1,whl2,whl3 from DB you have to corresponding services and map results to localStorage, then in function get that results from storage.
As for "the values of each wheel would have relationships with the others" this should help http://docs.appery.io/tutorials/build...