5 posts
  • Bought between 1 and 9 items
  • Has been a member for 1-2 years
beaumont2000 says

I am trying to achieve events of calendar through this code.

var jsonObj = [];

for (var x = 0; x < 5; x++)
{

item = {}

item ["title"] = x;

item ["start"] =new Date(y, m, x);

item ["backgroundColor"] = App.getLayoutColorCode('yellow');

jsonObj.push(item);}

jsonString = JSON.stringify(jsonObj);    

alert(jsonString);

When i am putting jsonString in the calendar events like this :

events: [jsonString]

Its not working and when i alert value of jsonString and put that value in events directly instead of put “jsonString” as shown above then its working fine.

So please let me know how to acheive the same using jsonString.

 (for example:'events: [jsonString]')

Any help in right direction would be much appreciated.

by
by
by
by
by
by