jQuery UI Widgets › Forums › Scheduler › Cannot read property 'getAttribute' of null
This topic contains 4 replies, has 2 voices, and was last updated by contreforme 7 years, 4 months ago.
-
Author
-
Hello,
i got the following error since today when resizing an event :
Uncaught TypeError: Cannot read property 'getAttribute' of null jqxscheduler.js:9
here’s the event tree :
_handleTimelineDayWeekViewResize @ jqxscheduler.js:9 _handleResize @ jqxscheduler.js:9 (anonymous) @ jqxscheduler.js:10 dispatch @ jquery.min.js:3 q.handle @ jquery.min.js:3
Do you have any idea why ?
after some digging I found it may be a cache problem with developer tools… i’ll get back if i find anything.
We do not. It does not happen in our demos.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks Peter, I supposed it was a side effect, it may be linked but now it seems I cannot display some appointements without any explanation.
Here’s the code (simplified and anonymized) :
var schedules = []; // data is from an ajax call // push all events in array $.each(data.fetched, function(i, el){ var o = { id: el.id, to: new Date(el.ends), from: new Date(el.starts), venue: el.venue, subject: el.label }; schedules.push(o); }); var sch_object = { id: 'id', dataType: 'array', dataFields: [ {name: 'id', type: 'string'}, {name: 'to', type: 'date', format: "yyyy-MM-dd HH:mm"}, {name: 'from', type: 'date', format: "yyyy-MM-dd HH:mm"}, {name: 'venue', type: 'string'}, {name: 'subject', type: 'string'} ], localData: schedules }; $.each($('div.scheduler'),function(i, el){ $(el).jqxScheduler({ width: 1152, showLegend: false, showToolbar: false, editDialog: false, timeRulerWidth: 40, theme: 'metrodark', appointmentDataFields: { id: 'id', to: 'to', from: 'from', subject: 'subject', resourceId: 'venue' }, date: new $.jqx.date(myDate), height: ( 103 * venues.length ) - 6, source: new $.jqx.dataAdapter(sch_object), resources: { dataField: 'venue', orientation: 'vertical', resourceRowHeight: 70, source: new $.jqx.dataAdapter(venues_src) // works }, views: [ schedule_view ] }); });
it works for most of the data – 20 days with between 3 to 20 appointments on each day – but on one occasion (the 11th) only the first appointment is rendered then it just skip all the others and goes on to the next scheduler…
Is there a debug mode the follow each scheduler steps ?
I found out.
When jqxscheduler parses through appointments if the appointment ends before it starts, the whole process die silently. But due to the amound of appointment and scheduler in my script it’s not been easy to track down.
This should be corrected IMHO, at least a warning or something.
And the debug mode could be a useful tool as well 😉 -
AuthorPosts
You must be logged in to reply to this topic.