ColVis - Show/Hide column i want ordering change that list

ColVis - Show/Hide column i want ordering change that list

hvmhvm Posts: 26Questions: 0Answers: 0
edited November 2013 in Plug-ins
Hi,
I m new with this and it working with asp.net.
I want Show/Hide column list order change and based on that table display column in given order from Show/Hide column list.


please see below code

var oTable;
$(document).ready(function () {



oTable = $('#myDataTable').dataTable({
"sDom": 'C<"clear">lfrtip',

"oColVis":
{
"activate": "mouseover",
"buttonText": "Change columns",

},
"oColReorder": {
},
"sScrollX": "100%",
"sScrollXInner": "150%",
"bScrollCollapse": true,
"bPaginate": true,
"bStateSave": false,
"sPaginationType": "full_numbers",
"bAutoWidth": true,
"bJQueryUI": false,
"bLengthChange": true,
"bServerSide": true,
"sAjaxSource": "Default.aspx/binddata",
"fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
var data1 = JSON.stringify(aoData);
$.ajax({
type: "POST",
url: sUrl,
contentType: 'application/json',
dataType: 'json',
data: "{'Collection': '" + data1 + "'}",
success: function (json) {

var s = $.parseJSON(json.d);
fnCallback(s);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText)
}
});
},

"aoColumns": [
//Assign the data to rows
{"mDataProp": "ID" },
{ "mDataProp": "Name" },
{ "mDataProp": "Address" },
{ "mDataProp": "Town" },
{ "mDataProp": "Country" },
{ "mDataProp": "Email" },
{ "mDataProp": "Gender" },
{ "mDataProp": "Phone", "bVisible": false }
]
});
new FixedColumns(oTable, {
"iLeftColumns": 2,
"iLeftWidth": 350
});
});
This discussion has been closed.