ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: stoodin on April 23, 2014, 11:05:39 pm

Title: Adding row in pqgridcellsave throws Uncaught TypeError
Post by: stoodin on April 23, 2014, 11:05:39 pm
Hi guys,
I am adding a row in the cell save event and it gives me a following exception:
Uncaught TypeError: Cannot read property 'offsetParent' of undefined
The exception happens only when I click with mouse on another cell withing the grid. Tab is working fine.
The code is very simple:
    $grid.on("pqgridcellsave", function (evt, ui) {
        var newVal = ui.newVal, dataIndx = ui.dataIndx, rowIndx=ui.rowIndx;
       
        if (newVal) {
            var data = $grid.pqGrid("option","dataModel.data");
            if (data) {
                var rowsCount=data.length-1;
                if (rowsCount == rowIndx) {
                    $grid.pqGrid("addRow", {rowData:{}});
                }
            }
        }
    });

Here is the call stack:
Uncaught TypeError: Cannot read property 'offsetParent' of undefined pqgrid.min.js:9
g._generateCellRowOutline pqgrid.min.js:9
(anonymous function) jquery-ui-1.10.4.custom.js:401
g._editCell pqgrid.min.js:9
(anonymous function) jquery-ui-1.10.4.custom.js:401
g.editCell pqgrid.min.js:9
(anonymous function) jquery-ui-1.10.4.custom.js:401
(anonymous function)
Title: Re: Adding row in pqgridcellsave throws Uncaught TypeError
Post by: paramvir on April 25, 2014, 12:19:35 am
Thanks for pointing out this error.

I checked it and didn't face this error unless there is a datepicker editor in of the cells.

Do you also face this issue when there is a datepicker editor.
Title: Re: Adding row in pqgridcellsave throws Uncaught TypeError
Post by: stoodin on April 25, 2014, 01:59:35 am
I actually have a dropdown editor.
The complete test code to reproduce it attached.
Would be great if you can fix it :-)
Title: Re: Adding row in pqgridcellsave throws Uncaught TypeError
Post by: paramvir on May 28, 2014, 09:47:18 am
Please check it with latest version 2.1.0. I presume it's fixed.