Quantcast
Viewing all articles
Browse latest Browse all 82158

ColVis and Editor

Im trying to play around and testing the Editor. I prefer the twitter bootstrap version and I'm trying to add different extras that can be found here: http://datatables.net/extras/

I want to add ColVis to my twitter bootstrap Editor.

The example page has this javascript:
<script type="text/javascript" charset="utf-8" id="init-code">
var editor; // use a global for the submit and return data rendering in the examples

$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "php/browsers.php",
"domTable": "#example",
"fields": [ {
"label": "Browser:",
"name": "browser"
}, {
"label": "Rendering engine:",
"name": "engine"
}, {
"label": "Platform:",
"name": "platform"
}, {
"label": "Version:",
"name": "version"
}, {
"label": "CSS grade:",
"name": "grade"
}
]
} );

$('#example').dataTable( {
"sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"sAjaxSource": "php/browsers.php",
"bServerSide": true,
"sServerMethod": 'POST',
"aoColumns": [
{ "mData": "browser" },
{ "mData": "engine" },
{ "mData": "platform" },
{ "mData": "version", "sClass": "center" },
{ "mData": "grade", "sClass": "center" }
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );
</script>

What I did was adding this peace of code:

<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
var oTable = $('#example').dataTable( {
"sDom": 'C<"clear">lfrtip'
} );
} );
</script>
To enable ColVis but I get this error: DataTables warning (table id ='example'): Cannot reinitialise DataTables.

How do i add ColVis to the Editor?

Viewing all articles
Browse latest Browse all 82158

Trending Articles



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