Javascript error when moving recurring appointments - javascript

Using the RadSchedular, a RadWindow appears when moving an appointment in a series of recurring appointments asking me if I want to move them al or just the current appointment.
No matter what I choose an error is thrown telling me that object 'this' does not contain a method called 'get_owner'.
The Telerik.Web.UI dll's are on version 2014.2.724.40 and the project is an ASP.NET project.
The error occurs in a dynamic blank script and looks like this:
_onAppointmentMoveCallback:function(j,h){h.Scheduler._raiseRecurrenceActionDialogClosedEvent(h,false,b.RecurrenceAction.Move);
var k={appointment:h.Appointment,newStartTime:h.NewStart,editingRecurringSeries:j,targetSlot:h.TargetSlot,isAbortedByUser:false};
var i=a.raiseCancellableControlEvent(h.Scheduler,"appointmentMoveEnd",k);
//Error in next if()
if((this.get_owner().get_groupBy()!==g)&&this.get_owner()._webServiceSettings.get_isEmpty()&&h.Appointment.get_resources().indexOf(h.SourceSlot.get_resource())==-1){i=true;
}if(!i){h.Scheduler.moveAppointment(h.Appointment,j,h.SourceSlot,h.TargetSlot);
}else{h.Appointment._abortDrag();
}}
If I understand correctly, this is Telerik's internal code and I can't do anything about it? Is there anyone who encountered the same problem?
These two images reflect on the debugger state:

Related

DataTable SearchPanes breaks when executing rebuild()

I am using SearchPanes and it nearly works all perfect - My DataTable fields can dynamically change and therefore I also need to rebuild the SearchPanes data since it can show information which is no longer on the table.
From DataTable SearchPane documentation I am aware that they have 2 functions to achieve this:
executing datatable().searchPanes.rebuild()
executing datatable().searchPanes.rebuildPane(paneIndex)
When I execute the 1st option I get the following:
jquery.dataTables.min.js:360 Uncaught RangeError: Maximum call stack size exceeded
at new v (jquery.dataTables.min.js:360)
at v.iterator (jquery.dataTables.min.js:369)
at v.<anonymous> (dataTables.searchPanes.min.js:101)
at Function.rebuild (jquery.dataTables.min.js:377)
at v.<anonymous> (dataTables.searchPanes.min.js:101)
at v.iterator (jquery.dataTables.min.js:369)
at v.<anonymous> (dataTables.searchPanes.min.js:101)
at Function.rebuild (jquery.dataTables.min.js:377)
at v.<anonymous> (dataTables.searchPanes.min.js:101)
at v.iterator (jquery.dataTables.min.js:369)
Besides, when I execute the 2nd option I do not get any exception but all the searchPanes get completely blocked and I cannot use them to filter anything at all.
I am currently using SearchPanes version 1.2.1
Should I be doing this in order to achieve what I want to do? What am I making wrong?
Thanks in advance :)

OfficeJS addHandlerAsync callback does not execute angular component method

I am working on an outlook web add-in (in Angular 5) and I am implementing a pinnable task pane and I've been following this documentation from Microsoft : Implement a pinnable task pane in Outlook.
What I want to do is when the selected mail in Outlook was changed, I need to update the content of my task pane UI.
On My Component.TS
I added the following addHandlerSync event listener for change on mail selection:
ngOnInit() {
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, this.selectMailChanged);
}
selectMailChanged(){
this.getPhoneNumbers() //This function gets phone numbers on the email
}
The error of the above code is
this.getPhoneNumbers is not defined.
I tried enclosing this this.getPhoneNumbers on zone (based on MS Documentation: Trigger the UI update) but it returns zone.run is not defined.
How can I call an angular component method on addHandlerAsync callback?
Good old famous this keyword problems.
You're getting that error message because of the context difference. When you're writing the code, the method selectMailChanged references the method getPhoneNumbers (which I'm hoping you have it implemented) in your component. So coding-wise it looks good.
But when the event kicks in - it doesn't have the context of the component anymore, because it's just calling a callback function - so it doesn't really have all the outside world information except the function that it's calling into. You can read a few good answers about this below:
How to access the correct `this` inside a callback?
https://thenewstack.io/mastering-javascript-callbacks-bind-apply-call/
https://technology.amis.nl/2016/08/23/access-the-original-calling-context-in-a-callback-function-in-typescript/
Move the functionality in getPhoneNumbers to the callback method and you shouldn't have this problem.

"Warning: Failed propType: Required prop 'fields' was not specified in 'ReduxForm(MyForm)'"

I've just added Redux to my React app and I thought it was working but now I keep getting two errors in my console.
This:
Warning: Failed propType: Required prop 'fields' was not specified in
'ReduxForm(MyForm)'. Check the render method of
'Connect(ReduxForm(MyForm))'.
and this:
Uncaught TypeError: Cannot read property 'reduce' of undefined
The second refers to this (line 2):
var getValues = function getValues(fields, state) {
return fields.reduce(function (accumulator, field) {
getValue(field, state, accumulator);
return accumulator;
}, {});
};
Upadte/Answer:
Make sure redux-form is version 6 or higher
Teach a man to fish!
You have not really given enough codes to go on.
If fields are unexpectedly undefined then you should step through with chrome debugger or console.log everywhere. These are highly underrated methods!
In the browser hit the F12 key.
Select the Scripts , or Sources , tab in the developer tools.
Hit control+p and enter in the path to the file you are looking for.
(Or located little folder icon in the top level to find your file.)
Add a breakpoint by clicking on the line number on the left (adds a
little blue marker)
Execute your JavaScript.
Your code will run until it stops at the breakpoint and you can step forward from there. If you need to check every line then add breakpoints on all lines before stepping through. You can right click variables to add to watch list.
Keep going until you find a faulty logic, undefined/null, or bug occurs. Note that you can console.log() at any time from the console while the code is paused on a breakpoint and it will log correctly for variables in scope.

KnockoutJS - Select dropdown binding not working

Im working on a project to build a CRUD system using knockout and getting and saving my data via AJAX. Been having issues binding the select dropdown. When I try to edit an incident I get the following error:
Uncaught TypeError: Cannot read property 'push' of undefined
I created a jsfiddle http://jsfiddle.net/rqwku4kb/20/ to demonstrate the issue. I'm still working on the delete and add a new incident link so they are not working yet but im working on that seperately.
Here is the code that`s causing me issues at the moment.
self.ShowMeTheCurrentSelectedIncident = function(data) {
self.currentIncident();
self.chosen_composante.push([data.Composante]);
};
Would anyone have have any idea where the issue might be or be able to provide me some advice?
The method here is what's wrong:
self.ShowMeTheCurrentSelectedIncident = function(data) {
self.currentIncident(); // (1)
self.chosen_composante.push([data.Composante]); // (2)
};
What this does:
(1) get the value of the observable currentIncident and then throw it away. It's always null and never set so this is doubly redundant.
(2) Reference an undefined variable called chosen_composante which does not exist in IncidentList.
I could not fix this for you since I wasn't sure what values were to go where, but it should be enough to set you on the right track - you're confusing the properties of the IncidentList and Incident

JavaScript Invalid Argument

I have a complex function that loops through the elements during the onSuccess: of my js and I'm getting the following error that I haven't seen before.
exception encountered : {"message": "Invalid argument.", "description": "Invalid argument.", "number": -2147024809, "name": "Error"}
The js function looks like this:
if(Object.isArray(list)){
list.each(function(listItem, index){
if(!Object.isUndefined(listItem.disabled)){
listItem.disabled = disableFlag;
}
});
}
that is called from the onSuccess: portion of an Update. My html is a button that is calling the noted function from an onclick. When I run it the onException: always happens and I'm getting the error by:
Object.toJSON(exception)
Has anyone seen this before? I have tried playing around with the functionality and it seems that when I use the button to do what it's supposed to do after a specific sequence of events is the only time this happens. So, I placed an arbitrary link on the page and wanted to see if I clicked that, what would happen and it updated the JSON object on the page and allowed for me to use the button for it's set action without the error. Any help would be appreciated.
Most of the time this kind of error happens in IE when you set an attribute of a DOM element.
If listItem is DOM element then maybe it's not yet added to the document or disableFlag is an invalid value. Or the error happens outside the provided code.

Categories

Resources