Hi there,
I have developed an application that has two combobox columns in a grid - one for selecting a company and one for selecting a person that works at the company.
The comboboxes are searchable so as you type they filter a dataset form an api and web service call to a database (for the purposes of the sample application the API call auto generates company and person names)
There are a few problems with this app though where it throws ej2 script errors.
I have Global function for catching unhandled exceptions:
$(function () {
// Function to catch any unhandled Errors on any page
window.onerror = function (msg, url, lineNo, columnNo, error) {
var string = msg.toLowerCase();
var substring = "script error";
if (string.indexOf(substring) > -1) {
alert('Script Error: See Browser Console for Detail');
}
else {
var message = [
'Message: ' + msg,
'URL: ' + url,
'Line: ' + lineNo,
'Column: ' + columnNo,
'Error object: ' + JSON.stringify(error)
].join(' - ');
alert(message);
}
return false;
};
The following error messages are caught by the unhandled exception function
#1 If you search for a company and then click the clear button on the combo box it throws an ej2 exception:
Message: Uncaught RangeError: Maximum call stack size exceeded
URL: http://solocal.com/DesktopeAccept/Scripts/ej2/ej2.min.js
Line: 1 - Column: 4778067 - Error object: {}
#2 you can also search for persons who are not associated with a company by leaving the combobox for company empty when adding a new row and just searching using the person combobox.
you then click out of that row to force an update (or click the update button in the toolbar) you will get the following unhandled exception:
Message: Uncaught TypeError: Cannot read property 'parentNode' of null
URL: http://solocal.com/DesktopeAccept/Scripts/ej2/ej2.min.js
Line: 1 - Column: 9167 - Error object: {}
Closing that alert you will sometimes get a recursive error of:
Message: Uncaught RangeError: Maximum call stack size exceeded
URL: http://solocal.com/DesktopeAccept/Scripts/ej2/ej2.min.js
Line: 1 - Column: 7386948 - Error object: {}
This usually happens if this is the first row that you are adding to the grid.
The appplication has been updated to a later version of ej2 javascript file to fix the problem of the grid header of the checkbox column not updating correctly on load
The original JS file is included in the application though - this also displays the errors mentioned above.
I would be grateful if you could take a look at this to see if the problem is of my making or if there is something that i can do to prevent these errors.
The project was too large to upload so I have made it available to download here
Cheers James
Hi Sujith,
to fix the problem that you were getting you just need to change the properties of the project to use "IIS Express" instead of "Local IIS" in the web tab of the project properties.
Anyway changing the reference i still get errors https://cdn.syncfusion.com/ej2/dist/ej2.min.js
I have uploaded a new version that is configured to use IIS Express. Steps to reproduce the problem
Hi Rajapandiyan,
do you have an update on this problem as of yet?
Cheers James
|
function CompanyChange(args) {
if (args.itemData != null) {
this.dataSource = [args.itemData];
SelectedCompany = args.itemData.Id;
//load all persons into the combo
model.clientModel =
{
ContactId: SelectedCompany,
ContactSearchString: ''
};
. . . . . . . . . . . . . . . . . .
} |
hi Rajapandi,
I will amend the code accordingly next week, many thank for this suggestion
Cheers James
Hi Rajapandi,
your suggestion seems to have fixed the problem on the original application so thanks for that.
Cheers James
Hi Rajapandi,
I have found another problem with the grid and have created another fully stripped down sample app for you: which you can download here
The error is only in the IE browser though but comes up when the Add button is clicked.
Many thanks in advance
James
|
Layouts.cshtml
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
|
Thanks Rajapandi, that works a treat!! :)