bug: Unable to set value of the property '0': object is null or undefined
bug: Unable to set value of the property '0': object is null or undefined
mzNextstep
Posts: 8Questions: 0Answers: 0
trying to use DataTables on some premade tables and I get this error during loading. It's pointing to line 1830 in the un-minified nightly code:
[code]aLayout[i+k][iColShifted+l] = {
"cell": nCell,
"unique": bUnique
};
[/code]
when i run the debugger plugin, it only says that jquery isn't loaded, which is obviously untrue. I believe that is failing due to some complicated iframe legacy code nonsense, but probably unrelated to the issue at hand.
my table is a little complicated, but really not that bad:
[code]
~Outcomes~
~Goals~
~Problems~
Add New ~Problem~
Reorder ~Problems~
Stuttering
Edit
i dunno
Edit
anotehr one
Edit
Total ~Goals~ linked:
'A better person
♦ ♦ Another Laurie Goal
live happily ever after
♦ ♦ be a hero
[/code]
with the following css (just so you can see it as I do)
[code].scrollDiv {
width: 100%;
height: 100%;
overflow-x: scroll;
overflow-y: scroll;
}
table,tr {
border-style: none;
}
#grid {
width: 100%;
border:3px solid #901712;
background-color:white;
table-layout:fixed;
}
.gridCells {
border-style: solid;
border-color: #333333;
border-top-width: 1px;
border-bottom-width:0px;
border-left-width: 1px;
border-right-width: 0px;
margin: 0px;
}
.innerGridCells {
border-style: solid;
border-color: #333333;
border-top-width: 1px;
border-bottom-width:0px;
border-left-width: 1px;
border-right-width: 0px;
padding: 0px;
}
.normal {
border-style: none;
border-width: 0px;
padding: 0px;
}
div {
scrollbar-face-color : #CCCCCC;
}
li {
padding-top:1px;
}
.hide {
display:none;
}
.hiddenText {
border: 0px none;
background-color: transparent;
font-style:normal;
color:black;
font-weight: bold;
text-align: center;
width: 100%;
padding: 0px;
}
.programSelection {
border-top:3px solid #901712;
border-left:3px solid #901712;
border-right:3px solid #901712;
padding-left:5px;
padding-top:10px;
padding-bottom:10px;
}
.programSelect {
display:inline;
}
.problemBox {
background-image: url(images/questionMark.gif);
}
.deferred {
background-color: #E9E9E9;
}[/code]
[code]aLayout[i+k][iColShifted+l] = {
"cell": nCell,
"unique": bUnique
};
[/code]
when i run the debugger plugin, it only says that jquery isn't loaded, which is obviously untrue. I believe that is failing due to some complicated iframe legacy code nonsense, but probably unrelated to the issue at hand.
my table is a little complicated, but really not that bad:
[code]
~Outcomes~
~Goals~
~Problems~
Add New ~Problem~
Reorder ~Problems~
Stuttering
Edit
i dunno
Edit
anotehr one
Edit
Total ~Goals~ linked:
'A better person
♦ ♦ Another Laurie Goal
live happily ever after
♦ ♦ be a hero
[/code]
with the following css (just so you can see it as I do)
[code].scrollDiv {
width: 100%;
height: 100%;
overflow-x: scroll;
overflow-y: scroll;
}
table,tr {
border-style: none;
}
#grid {
width: 100%;
border:3px solid #901712;
background-color:white;
table-layout:fixed;
}
.gridCells {
border-style: solid;
border-color: #333333;
border-top-width: 1px;
border-bottom-width:0px;
border-left-width: 1px;
border-right-width: 0px;
margin: 0px;
}
.innerGridCells {
border-style: solid;
border-color: #333333;
border-top-width: 1px;
border-bottom-width:0px;
border-left-width: 1px;
border-right-width: 0px;
padding: 0px;
}
.normal {
border-style: none;
border-width: 0px;
padding: 0px;
}
div {
scrollbar-face-color : #CCCCCC;
}
li {
padding-top:1px;
}
.hide {
display:none;
}
.hiddenText {
border: 0px none;
background-color: transparent;
font-style:normal;
color:black;
font-weight: bold;
text-align: center;
width: 100%;
padding: 0px;
}
.programSelection {
border-top:3px solid #901712;
border-left:3px solid #901712;
border-right:3px solid #901712;
padding-left:5px;
padding-top:10px;
padding-bottom:10px;
}
.programSelect {
display:inline;
}
.problemBox {
background-image: url(images/questionMark.gif);
}
.deferred {
background-color: #E9E9E9;
}[/code]
This discussion has been closed.
Replies
Allan
What I'm confused about now is that my table seems to be functionally identical to the table used in the example here: http://datatables.net/release-datatables/examples/advanced_init/complex_header.html with a few differences in the footer. Both have two rowspan:2 cells followed by a colspan:3, and then 3 normal cells under it. When I try to use the same aoColumnDefs attr in my code, I just get that same error- Unable to set value of the property '0': object is null or undefined, and I don't see any other changes on that page that might make it work any differently (and even that bit of code, if I understand correctly, isn't meant to fix this issue, just hide a column). Is there any way you (or anyone) could explain why it works in the example, but not for me?
[code]
-- Unique cells
+===+===+===+
| | | |
+===+===+===+
| | | |
+---+---+---+
| | | |
+---+---+---+
| | | |
+---+---+---+
-- Not unique cells
+===+===+===+
| |
+===+===+===+
| | | |
+---+---+---+
| | | |
+---+---+---+
| | | |
+---+---+---+
[/code]
So DataTables can't tell in your example what the columns are. I really want to find a way to relax that constraint in future, but at the moment the problem is that it would break sorting and filtering since there is no way to uniquely address the column to fire those events.
Allan
So, if the problem is the colspan, how does the example get around it?
[code]
-- Doesn't work
+===+===+===+
| |
+===+===+===+
| | | |
+---+---+---+
| | | |
+---+---+---+
| | | |
+---+---+---+
-- Works
+===+===+===+
| |
+===+===+===+
| | | |
+===+===+===+
| | | |
+---+---+---+
| | | |
+---+---+---+
| | | |
+---+---+---+
[/code]
(where === indicates a header cell)
Allan
[code]
+===+===+===+===+===+
| | | |
+ + +===+===+===+
| | | | | |
+===+===+===+===+===+
| | | | | |
+---+---+---+---+---+
| | | | | |
+---+---+---+---+---+
...etc, with different footers
[/code]
What am I missing? Are they not the same?
Good timing as I was itching to pull the trigger on 1.9.4 - but certainly won't until this is fix.
Allan
I've just committed a fix for this and you'll be able to see this example working now:
http://live.datatables.net/uwebip/edit#javascript,html
The 1.9.4.dev version of DataTables with this fix is available on the downloads page ( http://datatables.net/download ) and 1.9.4 final will be released soon.
Thanks for flagging this up!
Regards,
Allan