Page 1 of 1

dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 3:18 pm
by Andy Parker

Hi,

I have a variable number of records stored in local storage and I want to use a grid with components in each row to display this data.

How in javascript can I achieve this to gain the same results as if it was a rest service propogating the grid?

the example below shows the current grids components, I merely want to address each item to fill the data and add a row as requried.

eg

--------------------------

|....IMAGE...|..label...|
|..................|..label1.|
|..................|..label2.|

--------------------------

many thanks

Andy.


dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 4:38 pm
by Kateryna Grynko

Hi Andy,

You can use Generic service: http://docs.appery.io/documentation/u...


dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 5:28 pm
by Andy Parker

thanks Katya,

I've setup the service, and no errors are reported.....however, no data maps either.

I've set the response to be an array of data

eg

gridarray array[tick]
.........shopname
.........shopowner

then, mapped the response to a grid and appropriate labels.

Then in the javascript implementation I have written a "While loop" that gets the data strings from local storage variables and return them:

eg

Have I misunderstood something?
Image


dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 7:03 pm
by Kateryna Grynko

Andy,

Not sure what you mean here:precodewhile (counter:shopowner});/code/pre
Probably you need this code instead:precodewhile (counter<maxcounter)/code/pre


dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 7:40 pm
by Andy Parker

sorry, I've edited the post and pasted a screenshot, the code wont display on this forum.


dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 9:14 pm
by Andy Parker

Any ideas on this Katya?


dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 9:48 pm
by Kateryna Grynko

Andy,

I'm sorry. Please check, should be displayed correctly now.


dynamically grow a grid using javascript....

Posted: Thu Jan 02, 2014 9:52 pm
by Andy Parker

Im sorry, I think I've confused you.

I've reposted the issue with the javascript that I use, this is not working, I dont get any data in the grid...

I've setup the service, and no errors are reported.....however, no data maps either.

I've set the response to be an array of data

eg

gridarray array[tick]
.........shopname
.........shopowner

then, mapped the response to a grid and appropriate labels.

Then in the javascript implementation I have written a "While loop" that gets the data strings from local storage variables and return them:

eg

Have I misunderstood something?
Image


dynamically grow a grid using javascript....

Posted: Fri Jan 03, 2014 1:38 pm
by Oleg Danchenkov