Quantcast
Viewing all articles
Browse latest Browse all 82130

Strange behaviour - help needed

Hello all
I'm new to dataTables but I've been progressing quite well until now when I'm stuck in a problem. I added this code to save the users' table settings on the server so that they can see the same tables when they work on different computers:
"fnStateSave": function(oSettings, oData){
		    $.post("ajax/dispatch.php?module=save_user_settings",
				{
				    "table": "clients",
				    "value": oData
				},
				function(data){ console.log(data) } // for me to see if all works well
				)
		    
		}
This works well, the settings are passed to the php program. Now let's read data back:
 "fnStateLoad": function (oSettings, callback) {
			$.ajax({		
				"type":"POST",
				"url" : "ajax/dispatch.php?module=load_user_settings",
				"async" : false,
				"data": {"table": "clients"},
				"success": function(data){
				    if (data=="")
				    {
			            ret=false;
				    }else{
				    ret=JSON.parse(data);    
				    }
				}
				});
			return ret;
	   },
This also works well, EXCEPT THE VISIBILITY OF COLUMNS. I checked: the visibility values are well stored in the database, but the table is rendered with all the columns visible.
I tried to "manually" set the column visibility properties:
"fnStateLoadParams": function(oSettings, oData){
		  cVis=oData.abVisCols;
	   },
"fnInitComplete": function(){
for (i=0;i<cVis.length;i++)
			    {
			    MyTable.fnSetColumnVis(i, (cVis[i]==='true') );
			    }
}
This works well until it finds FALSE values. For a TRUE value, fnSetColumnVis throws the error NOT_FOUND_ERR: DOM Exception 8.
Anybody has any idea? Any comments would be highly appreciated.
Thanks

Viewing all articles
Browse latest Browse all 82130

Trending Articles



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