Author Topic: Uncaught TypeError on mouse click  (Read 3694 times)

stoodin

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Uncaught TypeError on mouse click
« on: April 18, 2014, 12:31:31 am »
Hi guys,
I have a custom drop down editor that works just fine, however when I select first time the value in the cell and then click with the mouse on the next cell I am getting an error:
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)

It happens only first time and only on the mouse click. It is not visible from the user. Just an exception in console.
Tab and Enter work fine.
Any idea what I am doing wrong?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Uncaught TypeError on mouse click
« Reply #1 on: April 18, 2014, 01:21:08 pm »
Could you provide a small test case so that the issue can be reproduced.

stoodin

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Re: Uncaught TypeError on mouse click
« Reply #2 on: April 18, 2014, 11:56:16 pm »
The error happens when I try to add a new row like this:
    $grid.on("pqgridcellsave", function (evt, ui) {
        var newVal = ui.newVal;
        var dataIndx = ui.dataIndx;
        var rowIndx=ui.rowIndx;
       
        if (newVal) {           
            var newVal = ui.newVal, dataIndx = ui.dataIndx, rowIndx=ui.rowIndx;
            if (newVal) {
                var rowsCount=$grid.pqGrid("option","dataModel.data").length-1;
                if (rowsCount == rowIndx) {
                    console.log("Step 1");
                   
                    $grid.pqGrid("addRow", {rowData:{recordID:'',type:'',sun_st:'',sun_end:'',mon_st:'',mon_end:''}});
                    console.log("Step 2");
                   
//                    $grid.pqGrid("refreshRow", rowIndx+1);                   
//                    console.log("Step 3");
                }
            }
        }
    });