Page 2 of 5

Way to display lots of database data

Posted: Sat Jan 24, 2015 12:31 pm
by M&M

As for this question

I'm not sure im going to be able to have all the data on one line?. How could i make it that each list item becomes a link to a new page with all the data from that db entry?

I'd say that when someone clicks on that list item, save the values to either local storage varibles, or global JS variables, and then in the page show event of the new page, populate the labels with those values.

Cheers,
M&M


Way to display lots of database data

Posted: Sat Jan 24, 2015 12:31 pm
by Simon Hutchinson

Thanks again!

What type of control are you using to display the data, just a list? Im sorry if you already answered that but the screenshot looks a diff to what i see?


Way to display lots of database data

Posted: Sat Jan 24, 2015 12:32 pm
by Simon Hutchinson

ahh you're using labels :)


Way to display lots of database data

Posted: Sat Jan 24, 2015 12:32 pm
by M&M

I am using a list component...but i guess even the select component should work equally well

Cheers,
M&M


Way to display lots of database data

Posted: Sat Jan 24, 2015 12:32 pm
by Simon Hutchinson

So it appears you've used a list and then put labels on top of the list, is that right? and i assume that those labels are hidden?


Way to display lots of database data

Posted: Sat Jan 24, 2015 12:38 pm
by M&M

Well, let me try to post the code based on your screenshot and components

The mapping over here
Image

Should carry the following JS Code

var strConcatenated = value.Name + " " + value.Team + " " + value.ID + " " + value.shirt + " " + value.Minute + value.Reason;

var componentConcatenated = element.find('[name="mobilelabel_18"]');
componentConcatenated.text(strConcatenated);
return value;


Way to display lots of database data

Posted: Sat Jan 24, 2015 12:48 pm
by Simon Hutchinson

hi thanks for your help!

i have done this mapping

http://snag.gy/r8v6N.jpg

but i am still only getting one record back, where do you think i might be going wrong?

From what i can tell the JS is used to concatenate data as opposed to loop the data so i don't think its that? (cheers for that, it really helps though!)


Way to display lots of database data

Posted: Sat Jan 24, 2015 1:03 pm
by M&M

I'd say proceed with the troubleshooting this way

First - Just do a regular mapping - to all the individual components...and see if all the records are being retrieved. If yes then we can proceed to the next step, where we just add another label component...and get the JS Script to populate it with the concatenated values.

Cheers,
M&M


Way to display lots of database data

Posted: Sat Jan 24, 2015 1:14 pm
by Simon Hutchinson

hi yep absolutely thats what i've been doing and i just cannot get it to loop.


Way to display lots of database data

Posted: Sat Jan 24, 2015 1:16 pm
by M&M

oke can I see the resulting screen? And also the Screen in Design Mode?

M&M