I'm using version 2017.2, IgGrid with the Updating feature, with editMode set to 'cell'. When the editCellEnded event fires, I make an Ajax call to the server and save the record. Everything works fine.
Then when the user wants to go back to the prior page, I call the Destroy method of the grid. It gives the following error:
ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQrU26YvA_aRlieYuDfZ55ZlcoE0uK0YeZWqYFcmgzLrld_TqZOJIkL36yHh5oNo53h1YHV3Lz_TsjBy6SGewduJUbzz8MS2xtHhq6O1sl6SJhF6po4L2mw8xb6w-n-VthrZyJfLEsQrIpNluVsR-yPA1&t=ffffffffad4b7194:237 Uncaught Error: Sys.ParameterCountException: Parameter count mismatch. at Function.Error$create [as create] (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQrU26YvA_aRlieYuDfZ55ZlcoE0uK0YeZWqYFcmgzLrld_TqZOJIkL36yHh5oNo53h1YHV3Lz_TsjBy6SGewduJUbzz8MS2xtHhq6O1sl6SJhF6po4L2mw8xb6w-n-VthrZyJfLEsQrIpNluVsR-yPA1&t=ffffffffad4b7194:237) at Function.Error$parameterCount [as parameterCount] (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQrU26YvA_aRlieYuDfZ55ZlcoE0uK0YeZWqYFcmgzLrld_TqZOJIkL36yHh5oNo53h1YHV3Lz_TsjBy6SGewduJUbzz8MS2xtHhq6O1sl6SJhF6po4L2mw8xb6w-n-VthrZyJfLEsQrIpNluVsR-yPA1&t=ffffffffad4b7194:413) at String$trim (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQrU26YvA_aRlieYuDfZ55ZlcoE0uK0YeZWqYFcmgzLrld_TqZOJIkL36yHh5oNo53h1YHV3Lz_TsjBy6SGewduJUbzz8MS2xtHhq6O1sl6SJhF6po4L2mw8xb6w-n-VthrZyJfLEsQrIpNluVsR-yPA1&t=ffffffffad4b7194:500) at t.(anonymous function).(anonymous function)._removeAttributes (localhost/.../infragistics.lob.js:104:8201) at t.(anonymous function).(anonymous function)._removeAttributes (localhost/.../jquery-ui.min.js:6:4499) at t.(anonymous function).(anonymous function)._restoreDOMStructure (localhost/.../infragistics.lob.js:104:7097) at t.(anonymous function).(anonymous function)._restoreDOMStructure (localhost/.../jquery-ui.min.js:6:4499) at t.(anonymous function).(anonymous function).destroy (localhost/.../infragistics.lob.js:104:13393) at t.(anonymous function).(anonymous function).destroy (localhost/.../jquery-ui.min.js:6:4499) at Class.destroy (infragistics.lob.js:157)
Please help!!
Pete
Hello Peter,
Thank you for posting in our forum.
This is a generic error that get thrown by the Microsoft Ajax Library when an invalid number of arguments gets passes to a method (or a function). The most likely reason is that one of the values you are submitting is “null” or “undefined”, which would cause the JavaScript proxy to drop the parameter completely.
Providing your code that sends the AJAX request from the client side to the server, as well as your grid initialization configuration would be much appreciated. It would allow me to get an idea of the way you pass the AJAX request parameters and give you a more precise answer.
Also, try debugging on you side by opening the "Network" tab in the browser's Dev Tools and inspect the request being sent to the server - this would allow you to check if there is an "undefined" or "null" value somewhere.
Feel free to contact me if you have any additional questions regarding this matter.
Hi Vasil,
I've looked at the requests and there's nothing that's null. I've commented out the Ajax call to the server after editCellEvent fires, and it still happens.
If I have a grid with the updating feature turned on, but don't do any edits to the records, I can call the destroy() method with no problems. However, if I manually click on one of the cells and change the value, the destroy() method causes the exception.
I understand your explanation of the Microsoft Ajax Library throwing an error, but I don't think it's from anything I've done. It seems the problem is coming from somewhere in your engine.
Thanks,
Thank you for the details and for checking the requests being sent to the server - that eliminates one possible cause of the issue.
I would appreciate if you please provide me with the code that sends the AJAX request to the server as well as the grid initialization configuration that you use - this way I would be able to create an isolated code sample on my side, try to reproduce this behavior and find the root cause of the problem.
Also, which exact build of Ignite UI 17.2 do you use? The version is written in the beginning of the product’s script files, or it could be checked at runtime by typing “$.ui.igGrid.version” in the browser console after they have been loaded.
If you need any additional assistance, feel free to contact me.
The call to the server looks like this: CLCService.ICLCService.UpdateEventInventory(saveJson, UpdateEventInventorySuccess, UpdateEventInventoryFail);
CLCService is a webservice, ICLCService is the class interface, and UpdateEventInventory is the server-side method that saves the data.
saveJson is a string representing the Json object that gets passed to the server. Its contents are: {"eventId":29,"inventoryEventDetails":[{"newRecord":false,"inventoryEventId":1737,"inventoryEventQuantityRequested":6,"inventoryEventQuantityUsed":5,"inventoryEventReduce":true,"inventoryEventNotes":"test","inventoryId":5232,"inventoryEventEditField":1}]}"
UpdateEventInventorySuccess is the success callback, and UpdateEventInventoryFail is the error callback.
The server-side method looks like this:
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
public SaveEventResult UpdateEventInventory(string jsonPacket)
SaveEventResult is a class that contains various fields for holding the save results.
The version is 17.2.495.
I hope this helps.
Thank you for the provided information, I am currently in the process of investigating this matter on my side and I will get back to you with more details soon.
Please do not hesitate to contact me with any updates or additional questions regarding this scenario in the meantime.
Thank you for your patience while I was looking into this matter for you.
After looking further in the stack trace, I believe the reason for the exception is the incorrect order of the scripts loaded. What I noticed is that the exception is in the ScriptResource.axd file when trying to call a trim() function. When calling destroy method of igGrid the _removeAttributes function is called and inside this function the jQuery trim() method is used. My assumption is that the ScriptResource file`s trim method has overridden the jQuery`s trim method, most probably with different parameters, and this is causing the exception.My suggestion for your scenario is to ensure that the ScripResources file is loaded before jQuery scripts. This will prevent the overriding of the trim functions.Please test this approach on your side and let me know if you need any further assistance with this matter.
Hi Alan,
I've tried moving the script references to the body, to no avail.
For a little more background, I have a master page. The master page has an ajax script manager in its body. Directly after the script manager is an asp content placeholder. There are numerous pages that use the master page as their master and reside in the content placeholder.
I looked at the file scriptresource.axd is loading, and it's microsoftajax.debug.js. I'd like to change the load order per your request but can't seem to accomplish this.
Sorry for the late response. Please advise.
Thank you.
Peter
Peter,
ScriptResource.axd is for JavaScript resources from an assembly and use by the ASP.NET AJAX framework. These would automatically be added to the page by the ScriptManager so you wouldn't see them in your code. I believe they are added to the head tag dynamically so they end up after any other scripts that you have included in the head tag.
If you were to look at the page as sent to the client in the network tools of the browser you should see additional scripts added after yours including the WebResource.axd scripts.
To see what is causing the conflict, you may need to identify what provides the file that causes the error:
String$trim (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQrU26YvA_aRlieYuDfZ55ZlcoE0uK0YeZWqYFcmgzLrld_TqZOJIkL36yHh5oNo53h1YHV3Lz_TsjBy6SGewduJUbzz8MS2xtHhq6O1sl6SJhF6po4L2mw8xb6w-n-VthrZyJfLEsQrIpNluVsR-yPA1&t=ffffffffad4b7194:500)
If you look at that file in the developer tools it is likely that there is a comment at the top of the file that tells you what the file is for that would give you a clue as to what is causing the conflict.
For testing loading jQuery after the ScriptResource.axd scripts, you could move all of your script references from the head to the body of your page and test to see if that indeed changes the behavior.
Let us know if you have any questions.
Hello Vasya,
I am not loading a ScriptResources.axd file anywhere that I'm aware of. Here are the scripts I load:
<script type="text/javascript" src="Scripts/DateFormat.js"></script> <script type="text/javascript" src="Scripts/jQuery/jquery.min.js"></script> <script type="text/javascript" src="Scripts/jquery-ui/jquery-ui.min.js"></script> <script type="text/javascript" src="Scripts/Infragistics/infragistics.core.js"></script> <script type="text/javascript" src="Scripts/Infragistics/infragistics.lob.js"></script> <script type="text/javascript" src="scripts/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="scripts/clcConstants.js"></script> <script type="text/javascript" src="scripts/clcUtils.js"></script>
I'm not sure what I need to do to implement your suggestion.