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.