jQWidgets Forums
jQuery UI Widgets › Forums › Grid › jqxGrid with jqxObservableArray causing 'Uncaught TypeError' exception.
This topic contains 5 replies, has 2 voices, and was last updated by jcwren 9 years, 11 months ago.
-
Author
-
May 19, 2015 at 5:56 pm jqxGrid with jqxObservableArray causing 'Uncaught TypeError' exception. #71286
I’ve created a grid with two text boxes and a drop-down list that uses a foreign key. When an ‘endcelledit’ event is fired, a function in jqxObservableArray is attempting to call itself, resulting in a ‘Uncaught TypeError: X is not a function’.
This jsFiddle (https://jsfiddle.net/jcwren/w01f3k6n/) demonstrates the issue.
Click the button to populate the array, then change the division for someone.
In my actual code, I also trigger an ‘endcelledit’ from a ‘cellselect’ event when leaving a text box, and the same error occurs (basically indicating it’s not directly related to drop-down lists).
There’s also a question about the behavior of jqxObservableArray. When populating the array (see line 114), if the unobserve(), observe() and jqxGrid calls are commented out, the grid populates with the names, but doesn’t populate the division column. The only way to get the grid to display the divisions properly is by resetting the source. Is this expected behavior, or should the push() call handle foreign key fields properly?
May 19, 2015 at 6:33 pm jqxGrid with jqxObservableArray causing 'Uncaught TypeError' exception. #71289This jsFiddle (https://jsfiddle.net/jcwren/j9pyfq07/) is a simplified version.
The problem appears to be that having any object or array in the data triggers the exception.
In this example, simply changing a competitors name will cause it.
May 19, 2015 at 7:17 pm jqxGrid with jqxObservableArray causing 'Uncaught TypeError' exception. #71291One (hopefully) last question. In the jqxObservableArray callback, or in the source ‘updaterow’ or ‘addrow’ callback, is it possible to change another field in the same record?
For instance, I have a date, and if the date is earlier than today, I want to force setting another field to a specific value. In the OA callback, using
this.set (change.index + ".flagged", "No")
fires another callback with with everything as I expect it, but the grid isn’t updated, and the flagged field isn’t changed in the source’s ‘updaterow’ callback. I’m guessing this is because it’s internally turning off observation during the callback. So what’s the correct way to do this?May 20, 2015 at 7:26 am jqxGrid with jqxObservableArray causing 'Uncaught TypeError' exception. #71320Hi jcwren,
No, it’s not possible in “updaterow” to change fields of another records. This will lead to another call of updaterow and so on.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comMay 20, 2015 at 2:01 pm jqxGrid with jqxObservableArray causing 'Uncaught TypeError' exception. #713491) I don’t want to change fields of other records, I want to know if it’s safe to change other fields within the *same* record, and what the preferred way of doing this might be.
2) On the ‘Uncaught TypeError’, can you confirm that you see this problem also, please?
May 27, 2015 at 2:42 am jqxGrid with jqxObservableArray causing 'Uncaught TypeError' exception. #71597Could youanswer the question in regards to the ‘Uncaught TypeError’, please?
Thank you.
-
AuthorPosts
You must be logged in to reply to this topic.