bDestroy error?
bDestroy error?
Hey all, total newbie here, so I probablyjust missed
something very easy.
Im using 1.7.3 and I need to redefine my table since a lot of
columns have changed (or is there a more dynamic way)?
When I try to use bDestry:true I get a a few different errors in datatables javascript impl:
1) Error 1,comes first time
[code]
oColumn is undefined
oSettings.aaSorting[i][1] = oColumn.asSorting[0]; jquery...bles.js (row 6627)
[/code]
2) error 2, comes each consequtove time:
[code]
oSettings.nTableWrapper is null
var nOrig = oSettings.nTableWrapper.parentNode; jquery...bles.js (row 2056)
[/code]
What I'm trying to to is the call below:
[code]
$('#datagrid').dataTable( {
"bDestroy" : true,
"aaData": [dummyData],
"aoColumns": cols
});
[/code]
something very easy.
Im using 1.7.3 and I need to redefine my table since a lot of
columns have changed (or is there a more dynamic way)?
When I try to use bDestry:true I get a a few different errors in datatables javascript impl:
1) Error 1,comes first time
[code]
oColumn is undefined
oSettings.aaSorting[i][1] = oColumn.asSorting[0]; jquery...bles.js (row 6627)
[/code]
2) error 2, comes each consequtove time:
[code]
oSettings.nTableWrapper is null
var nOrig = oSettings.nTableWrapper.parentNode; jquery...bles.js (row 2056)
[/code]
What I'm trying to to is the call below:
[code]
$('#datagrid').dataTable( {
"bDestroy" : true,
"aaData": [dummyData],
"aoColumns": cols
});
[/code]
This discussion has been closed.
Replies
Allan
twice, first time with empty aoColumns (ie just 'new Array'), which
is what causes the errors above.
After that it does not seem to get back in shape even with proper
initialization arguments. (Perhaps better validation should be added!?)
Many thanks for your very,very fast response!
// Bjorn
Allan
If you want me to, I could probably pinch down a very simple test page to display
this issue, is that of interest?
Also, similar, I notice that not all column headers are reset the way I expect:
For example I start off with a 6 column table and via bDestroy create a 4 column table,
then the headers of the remaining 2 columns (to the right , i.e. last) are still visible.
I could file a forum post under bugs also for this, if anyone is interested, the setup
is almost identical to the original problem.
Thanks,
Allan
In the below, with current, the remaining header issue is seen, column 4 and 5 should not be visible.
If I, at row 39 below, change the for loop to go 0 loops instead of 3 (change from i < 3 to i <=0), the first reported
issue is triggered.
[code]
a
b
c
d
e
a1
b1
c1
d1
e1
jQuery("#datagrid").dataTable()
var cols = new Array();
var dummyData = new Array ();
for (var i = 0; i < 3; i++) {
cols[i] = new Object();
cols[i].sTitle = "Column " + i;
dummyData.push("Colval: " + i)
}
$('#datagrid').dataTable( {
"bDestroy" : true,
"aaData": [dummyData],
"aoColumns": cols
});
[/code]