jQuery UI Widgets Forums Grid Grid JS error on LoadState

This topic contains 17 replies, has 4 voices, and was last updated by  Dimitar 7 years, 7 months ago.

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
  • Grid JS error on LoadState #69332

    Dimitar
    Participant

    Hi wsafa,

    Is this function used to dynamically populate your grid? Are there any errors thrown in your browser console when you call it? Please clarify and re-post your code, but remember to format it by selecting it and clicking the code button in the toolbar.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Grid JS error on LoadState #88657

    Satch
    Participant

    Just a note for this old thread. I had the exact same error as the poster indicated where I received the message:
    Unable to get property ‘datafield’ of undefined or null reference
    on the code:
    if(F._columns[H].datafield==this.datafield).....

    The error would indicate that one of the objects in the F.columns[] array was null.

    This error is caused by an extra comma in your grid’s column properties. For example, this would generate the exact error:

                   { text: 'A', datafield: 'afield', width: 40, filtertype: 'list', cellclassname: 'myColDef' },
    
                   { text: 'B', datafield: 'bfield', width: 50, filtertype: 'input', cellclassname: 'myColDef' },
    ,
                   { text: 'C', datafield: 'cfield', width: 100, filtertype: 'list', cellclassname: 'myColDef' },

    I didn’t catch it because the extra comma at the end of the second line doesn’t generate any errors and the grid functioned fine. Since most of my and also the JQXGrid methods I used had referred back to the rowdata.<datafield_name> instead of the column index, my program worked fine with no problems. The error cropped up when I tried to later add a save state functionality to the program which used a method that tries to use the column index. In this case <LoadState> uses the column index.

    Just thought I’d post this in case it can save someone some time if they run into this.

    Grid JS error on LoadState #88663

    Dimitar
    Participant

    Hello Satch,

    Thank you for your contribution.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 3 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic.