jquery - How to filter a very big json string without looping every object in it? -


I am currently developing a calendar with all the standard ideas (day, week, month).

I use JSON to load my calendar events when events are loaded, then I must map them to Active View (day, week or month).

For each view I only need a special set of events, see the events between the current date range (= time limit)

Therefore, whether for each view Is it possible to filter events (on the date) without the whole JSN object?

Now I am doing this:

  $ (eventCache.Events) .each (function () {// check if this event is displayed}} ;  

But the list of events can get up to two hundred, by this method the performance of the calendar is slowing down ...

This is an example of my data:

  { "d": { "__type": "GetEventsCacheResult", "Events": [{ "subject", "subject", "CalendarId": "139c9edd-b01b- 47cf-bae9 -18f3e3dca655 "," ColorCode ":" # 093,647 "," id ":" 0dab7ad9-46c7-e230-294e-0933e78eadae "," description ": null," DTStartDate ":" \ / Date (1244596500000) \ / " "DTEndDate": "\ / date (12 44610000000) \ / "," Start Date ":" 10/06/2009 1:15:00 "," End Date ":" 10/06/2009 5:00:00 "" AppointmentType ": 0," allday " : false}, { "subject", "subject", "CalendarId": "L39c9edd-B0lb-47cf-Bae9-l8f3e3dca655", "ColorCode": "# 093,647", "id": "0fddb3a0-65f1-08c7-daf2- 13da605b499b "," description ": null," DTStartDate ":" \ / date (1245823200000) \ / "," DTEndDate ":" \ / date (1245832200000) \ / "," StartDate ":" 24/06/2009 06 "", "End date": "24/06/2009 08:30:00", "AppointmentType": 0, "allday": false}, {"subject": "subject", "CalendarId": " L39c9edd-B0lb-47cf-Bae9-l8f3e3dca655 "," color code ":" # 093647 "," id ":" A 95 B 8 A 2 B -7 C 8A -677 F-DC 58-1 C 9836 D 72748 "," Description ": blank," DTSTAREDDET ":" \ / date (1247633100 000) \ / "," Ditiianddet ":" \ / Date (1247646600000) \ / "," StartDate ":" 15/07/2009 04:45:00 "," EndDate ":" 15/07/2009 08: "Date": "\ / Date (1238022000000) \ /", "Expiration Date"}, "Date"}, "Date"], "Date"], "Date": {"Start Date": "\" / Date (1285106400000) \ / "}}}  

once through its medium Loop and construction from hash of an associative array or grouped data that you want to filter it.

This is not necessarily true, but a suggestion is a group for those months, and then when someone asks for dates between June 15th and 12th August, you can add July immediately, and Can do just through the dates after June and August.

Again again, this can not be just effective before , sorting them first, doing binary search

how often you want to change Depending on this, for your first entry and then for final entry .

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -