Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82121

Can't load new table from ajax

$
0
0
Hello everybody and thanks again to everyone involved in the developing and manteining of this software.
I'm having a problem while re-creating my datatable with json data. The Json i'm sending contains aaData array and aoColumns array.
Every time the number of columns changes i get this error: TypeError: a.aoColumns[m] is undefined
I think it's because the number of columns changes, but it sounds strange to me because i send every time the new set of options for aoColumns.
Can someone please tell me how to fix that? thank you!

Here's my debug page:
http://debug.datatables.net/umaguj
And here's the code i'm using when creating the table:
HTML:
	<div class="row-fluid" id="contenitoreTabellaView">
		<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="tabellaView">
			<thead></thead>
			<tbody></tbody>
		</table>
	</div>
Javascript:
function riempiTabella(idCategoria){
	apriProgressBarModal();
	$.ajax( {
		xhr: function(){
			var xhr = new window.XMLHttpRequest();
			//Download progress
			xhr.addEventListener("progress", function(evt){
			  if (evt.lengthComputable) {
				var percentComplete = evt.loaded / evt.total;
				//Do something with download progress
				aggiornaProgressBarModal((percentComplete*100)| 0);
			  }
			}, false);
			return xhr;
		},
		"url": cUrlHttp + "ricetom1.asp?TK_TOKEN=&TK_DBASE=M&TK_UTEN=" + cUten + "&TK_TDV="+idCategoria+"&TK_STRI=&TK_CAMP=",
		"dataType": "json",
		"success": function ( json ) {
			json.sScrollX="100%";
			json.bScrollCollapse=true;
			json.sDom="<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>";
			json.bProcessing=true;
			json.bDestroy=true;
			tabella=$('#tabellaView').dataTable( json );
			chiudiProgressBarModal();
		}
	} );
}

Viewing all articles
Browse latest Browse all 82121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>