Author Topic: Error about " 'offsetLeft' is null or not an object"  (Read 6322 times)

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Error about " 'offsetLeft' is null or not an object"
« on: July 03, 2014, 11:12:48 am »
Hi,

I met a problem when I open my page on IE8. And the error message as the following:

'offsetLeft' is null or not an object
It's on the pqgrid.min.js, line 9. This statement:  H=parseInt(D.offsetLeft)

Do you know what cause this problem?

My pggrid version is  paramquery-2.0.4
There all file I include in my page
Code: [Select]
    <link rel="stylesheet" href="{!URLFOR($Resource.jqueryPPP, 'jquery-ui.css')}" />
    <script src="{!URLFOR($Resource.jqueryPPP, 'jquery.min.js')}"></script>
    <script src="{!URLFOR($Resource.jqueryPPP, 'jquery-ui.min.js')}"></script>

    <!--ParamQuery Grid files-->
    <link rel="stylesheet" href="{!URLFOR($Resource.paramQueryPro, 'pqgrid.min.css')}" />
    <script src="{!URLFOR($Resource.paramQueryPro, 'pqgrid.min.js')}"></script>

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Error about " 'offsetLeft' is null or not an object"
« Reply #1 on: July 03, 2014, 11:36:10 am »
It's difficult to say without an appropriate test case and exact line number of error in pqgrid.dev.js

Did you try to upgrade your files to 2.1.0

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Re: Error about " 'offsetLeft' is null or not an object"
« Reply #2 on: July 03, 2014, 12:03:52 pm »
It's difficult to say without an appropriate test case and exact line number of error in pqgrid.dev.js

Did you try to upgrade your files to 2.1.0

Hi,

I found the problem. It caused by this statement:

Code: [Select]
numberCell: { show: false}

Before, our user don't want to see the auto number for each row. But now for some other reason, we need to auto number for each row. So I change this attribution to "true", then I met the above error on IE8. When I change this attribute to "false". The records can display on my grid.

And for some reason I can't change my pggrid to latest version(210). I need to test this version first, and there are also some function add in this version, but before we wrote some codes to achieve these function.


Thank you!


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Error about " 'offsetLeft' is null or not an object"
« Reply #3 on: July 03, 2014, 01:57:22 pm »
Noctrona

There is no known issue in 2.0.4 with numberCell: { show: true} in IE8.

I re - checked it but didn't find any issue.

Quote
And for some reason I can't change my pggrid to latest version(210). I need to test this version first, and there are also some function add in this version, but before we wrote some codes to achieve these function.

Did you make changes to the pqgrid.min.js file?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Error about " 'offsetLeft' is null or not an object"
« Reply #4 on: July 03, 2014, 02:06:30 pm »
Try to add {resizable: false} in numberCell

numberCell: {show: true, resizable: false}

or remove numberCell option as it's {show: true, resizable: false} by default.
« Last Edit: July 03, 2014, 02:10:07 pm by paramquery »

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Re: Error about " 'offsetLeft' is null or not an object"
« Reply #5 on: July 03, 2014, 02:17:40 pm »
Try to add {resizable: false} in numberCell

numberCell: {show: true, resizable: false}

or remove numberCell option as it's {show: true, resizable: false} by default.

Hi,

I try these two way but still don't work. Also the same error : 'offsetLeft' is null or not an object

And I didn't modify pqgrid.min.js. I think there maybe some other parts in my js codes have conflict with this js. But for the moment, I haven't check all codes.
Now I change my pggrid to 210 and the auto number can works well.

And one more question about hidden attribute.
I just try to use version 210 in my page. And I found the hidden function have some problems.
I want to display/hidden column dynamical. So for example, I set the following column "hidden:fase", then when I click a button I will hidden this column. It's order is 10 on my table.
So
Code: [Select]
{ title: "T1 (Up-front Payment)", width: 57, dataType: "float", halign:"center", align: "right", dataIndx: "t1UpfrontPayment",hidden:false}

My js codes
Code: [Select]
var colM = $("#grid_json").pqGrid("option", "colModel");
colM[10].hidden = true;

$("#grid_json").pqGrid("option", "colModel", colM); 

These codes works well under the 2.0.4 version. But don't work under 210. And as before even I didn't set "hidden" in column, I can also get this attribute by js. But in 210 version, I debug the codes, if I didn't set "hidden" in column, I can't get this attribute.
« Last Edit: July 03, 2014, 02:19:56 pm by noctrona »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Error about " 'offsetLeft' is null or not an object"
« Reply #6 on: July 03, 2014, 02:28:01 pm »
refresh the grid after change in colModel

$grid.pqGrid("refresh");

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Re: Error about " 'offsetLeft' is null or not an object"
« Reply #7 on: July 03, 2014, 02:38:02 pm »
refresh the grid after change in colModel

$grid.pqGrid("refresh");

It works now by the "refresh".

And for the numberCell the 210 version can works well. I think there must be have some codes have conflict with our package js. May be we should use the latest version and test all function.


Thank you!