ERROR: oCol is undefined
ERROR: oCol is undefined
Hi guys,
please can someone help me?
I'm trying to instantiate TableTools under Ajax request. The data are retrieved but I'm getting "oCol is undefined" error.
I'm calling the JS and CSS dynamically, so the function about call the JS:
[code]
function ajaxpage(url, containerid){
var page_request = false;
var data;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid);
}
document.getElementById('menu_lateral').style.visibility='hidden';
var form = document.getElementById('frm_usr');
var oXMLHttp = objXMLHttp();
var semana_inicio = document.getElementById("semana_inicio");
var semana_fim = document.getElementById("semana_fim");
var sm_inicio = semana_inicio.options[semana_inicio.selectedIndex].text;
var sm_fim = semana_fim.options[semana_fim.selectedIndex].text;
var dados = "sm_inicio="+sm_inicio+"&sm_fim="+sm_fim;
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter+"&"+dados, true)
page_request.send(null)
//alert("carregando css...");
}
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).innerHTML=page_request.responseText;
loadobjs( 'DataTables-1.9.0/media/css/demo_page.css',
'DataTables-1.9.0/media/css/demo_table.css',
'DataTables-1.9.0/extras/AutoFill/media/css/AutoFill.css',
'DataTables-1.9.0/extras/TableTools/media/css/TableTools.css',
'DataTables-1.9.0/extras/ColReorder/media/css/ColReorder.css',
'DataTables-1.9.0/media/js/jquery.js',
'DataTables-1.9.0/extras/AutoFill/media/js/AutoFill.js',
'DataTables-1.9.0/media/js/jquery.dataTables.js',
'DataTables-1.9.0/media/js/ZeroClipboard.js',
'DataTables-1.9.0/extras/TableTools/media/js/TableTools.js',
'DataTables-1.9.0/media/js/Load_DataTable.js'
);
var objLoader = document.getElementById("carregador_pai");
objLoader.style.visibility = "hidden";
}
}
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i
please can someone help me?
I'm trying to instantiate TableTools under Ajax request. The data are retrieved but I'm getting "oCol is undefined" error.
I'm calling the JS and CSS dynamically, so the function about call the JS:
[code]
function ajaxpage(url, containerid){
var page_request = false;
var data;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid);
}
document.getElementById('menu_lateral').style.visibility='hidden';
var form = document.getElementById('frm_usr');
var oXMLHttp = objXMLHttp();
var semana_inicio = document.getElementById("semana_inicio");
var semana_fim = document.getElementById("semana_fim");
var sm_inicio = semana_inicio.options[semana_inicio.selectedIndex].text;
var sm_fim = semana_fim.options[semana_fim.selectedIndex].text;
var dados = "sm_inicio="+sm_inicio+"&sm_fim="+sm_fim;
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter+"&"+dados, true)
page_request.send(null)
//alert("carregando css...");
}
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).innerHTML=page_request.responseText;
loadobjs( 'DataTables-1.9.0/media/css/demo_page.css',
'DataTables-1.9.0/media/css/demo_table.css',
'DataTables-1.9.0/extras/AutoFill/media/css/AutoFill.css',
'DataTables-1.9.0/extras/TableTools/media/css/TableTools.css',
'DataTables-1.9.0/extras/ColReorder/media/css/ColReorder.css',
'DataTables-1.9.0/media/js/jquery.js',
'DataTables-1.9.0/extras/AutoFill/media/js/AutoFill.js',
'DataTables-1.9.0/media/js/jquery.dataTables.js',
'DataTables-1.9.0/media/js/ZeroClipboard.js',
'DataTables-1.9.0/extras/TableTools/media/js/TableTools.js',
'DataTables-1.9.0/media/js/Load_DataTable.js'
);
var objLoader = document.getElementById("carregador_pai");
objLoader.style.visibility = "hidden";
}
}
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i
This discussion has been closed.