My column with bVisible:false shows up randomly
My column with bVisible:false shows up randomly
vamshi4001
Posts: 5Questions: 0Answers: 0
I am having 3 columns with different numbers, I actually want to sort based on sum of these 3 columns. I haven't found a method to do so in datatables directly. So I used a 4th column which is a sum of these 3 columns. I had set it with bVisible:false and sorted based on it.
[code]"aoColumns": [
{ "mData": "team_id","sWidth": "10%" },
{ "mData": "team_name","sWidth": "30%" },
{ "mData": "team_twittercount","sWidth": "20%" },
{ "mData": "team_facebookcount","sWidth": "20%" },
{ "mData": "team_fb_talking_about_count","sWidth": "20%" },
{ "mData": "team_totalcount","bVisible" :false}
],
"aaSorting": [ [5,'desc'] ][/code]
but, randomly while repainting the datatable.. I am seeing this invisible column without column header. When ever thi shows up, the sorting doesn't happen. Can anyone please help at the earliest. Thanks in advance.
Check the issue on http://98.248.223.61/sfg/
Click on different items on sports list on left side - you may see it happening on 3rd or 4th selection.
[code]"aoColumns": [
{ "mData": "team_id","sWidth": "10%" },
{ "mData": "team_name","sWidth": "30%" },
{ "mData": "team_twittercount","sWidth": "20%" },
{ "mData": "team_facebookcount","sWidth": "20%" },
{ "mData": "team_fb_talking_about_count","sWidth": "20%" },
{ "mData": "team_totalcount","bVisible" :false}
],
"aaSorting": [ [5,'desc'] ][/code]
but, randomly while repainting the datatable.. I am seeing this invisible column without column header. When ever thi shows up, the sorting doesn't happen. Can anyone please help at the earliest. Thanks in advance.
Check the issue on http://98.248.223.61/sfg/
Click on different items on sports list on left side - you may see it happening on 3rd or 4th selection.
This discussion has been closed.
Replies
You are destroying the table each time - it would be for more efficient, and probably more reliable to use the fnReloadAjax plugin to reload the data.
Allan
Will use fnReloadAjax plugin.
Nice idea for a site bit :-)
Allan
Thanks :)
[code]
var oTable = $('#dtable').dataTable({
"bLengthChange": false,
"bAutoWidth": false,
"bDestroy":true,
"sAjaxSource":url,
"sPaginationType": "bootstrap",
//"bPaginate": false,
//"bScrollInfinite": true,
"aoColumns": [
{ "mData": "team_id","sWidth": "10%" },
{ "mData": "team_name","sWidth": "30%" },
{ "mData": "team_twittercount","sWidth": "20%" },
{ "mData": "team_facebookcount","sWidth": "20%" },
{ "mData": "team_fb_talking_about_count","sWidth": "20%" },
{ "mData": "team_totalcount","bVisible" :false}
],
"oLanguage": {
"sProcessing": ""
},[/code]
but I just see a text "Loading" initially and couldnot see anything while data is populated using fnReloadAjax. Is there a way to show loading gif as it serves as a great feedback to understand that some data is loading?
Allan