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