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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • jcwren
    Participant

    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?


    jcwren
    Participant

    This 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.


    jcwren
    Participant

    One (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?


    Peter Stoev
    Keymaster

    Hi 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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    jcwren
    Participant

    1) 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?


    jcwren
    Participant

    Could youanswer the question in regards to the ‘Uncaught TypeError’, please?

    Thank you.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.