I was loading a combo in lightbox fetching options from the database using:
scheduler.load("myWebService.asmx/GetComboOptions", "json");
and with the following configuration in scheduler.config.lightbox.sections:
{ name: "subject", height: 21, type: "select", map_to: "myComboOption", options: scheduler.serverList("myComboOption"), cache: true },
it was working great when using ASP.NET 2.0 (response from myWebService)
{"collections":{"myComboOption":[{"value":1,"label":"test1"},{"value":2,"label":"test2"},{"value":3,"label":"test3"}]}}
but after migrating to ASP.NET 3.5 (myWebService is returning also the “d” attribute breaking the json processing in dhtmlxscheduler)
{"d":{"collections":{"myComboOption":[{"value":1,"label":"test1"},{"value":2,"label":"test2"},{"value":3,"label":"test3"}]}}}
I make it work changing the following line in dhtmxScheduler source code:
var collections = (scheduler._temp && scheduler._temp.collections) ? scheduler._temp.collections : {};
With:
var collections = (scheduler._temp.d && scheduler._temp.d.collections) ? scheduler._temp.d.collections : {};
Another solution I think could work is using onBeforeLightbox event
scheduler.attachEvent("onBeforeLightbox", function (event_id){
//if the combo is empty load options from database using ajax
});
Anyway, I’m trying to keep using “scheduler.load” but I would prefer not to change the source code just to process the “d” attribute correctly. Is that possible?
Thanks!