search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

"'$c.colors[...]' is null or not an object" when using commandCallBack to update resource list in DayPilotSchedulerDynamic

Asked by Simon Kidd
13 years ago.


I have a DayPilotSchedulerDynamic with a lot of resources down the left hand side. Because of the number of resources, I have a couple of combo boxes at the top which the user can filter the list of resources with. Effectively to do this I fire a call to the SchedulerDynamic's commandCallBack (passing in the combo boxes values)when the combos' selections changes. In the code-behind, I then extract the values of the combo boxes, filter the underlying dataset, rebind the SchedulerDynamic and issue an Update specifying CallBackUpdateType.Full.

On the whole this works fine, but every now and then, only the first cell is coloured and an error occurs on the page. The error tells me, "'$c.colors[...]' is null or not an object".

Could you tell me what I'm doing wrong, as the solution seems to be very slick other than that?



Comment posted by Dan Letecky
13 years ago.

Please make sure that you refresh the Resources collection correctly during all events (including Command and Scroll). In the demo, the resources are defined in the .aspx file and this ensures they are always set properly. But if you fill the collection manually, you need to do it during CallBacks as well.

This is the most likely cause of the error message. If you feel it's not the case, please let me know.

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.