Possible bug with colvis, hide show columns and datatable
Possible bug with colvis, hide show columns and datatable
Hi
Been using your plugin for a while now, I really like it (including the users).
Today the users ran into an issue:
- Type search in some column filter (say column 8, the result from the search would be 3 rows)
- Hide a column (say column 1)
- Clear the filter (instead of getting the full resultset the resultset stays with the same 3 rows)
If you show column 1 and clear the filter they get the full dataset.
I inspected the post request that is made to the server, the field for the column 8 is not cleared in this case.
The snippet I use:
[code]
oTable = $("#filter_table").dataTable({
"sDom": '<"top"<"clear">iflp<"clear">C<"clear">rt>rt<"bottom"iflp<"clear">>',
"bJQueryUI": false,
"bStateSave": false,
"oColVis": {
"buttonText": "Show / hide columns",
"bRestore": true,
"sAlign": "left"
},
"aaSorting": [ [11,'desc'] ],
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'20'+
'30'+
'40'+
'50'+
'All'+
' records'
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "<?php echo site_url() . '/filter/ajax_filter/' . $rig_id; ?>",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback,
"cache": false
});
}
});
$("thead input").keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, $("thead input").index(this) );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("thead input").each( function (i) {
asInitVals[i] = this.value;
} );
$("thead input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("thead input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("thead input").index(this)];
}
} );
[/code]
Cheers
Flakron
Been using your plugin for a while now, I really like it (including the users).
Today the users ran into an issue:
- Type search in some column filter (say column 8, the result from the search would be 3 rows)
- Hide a column (say column 1)
- Clear the filter (instead of getting the full resultset the resultset stays with the same 3 rows)
If you show column 1 and clear the filter they get the full dataset.
I inspected the post request that is made to the server, the field for the column 8 is not cleared in this case.
The snippet I use:
[code]
oTable = $("#filter_table").dataTable({
"sDom": '<"top"<"clear">iflp<"clear">C<"clear">rt>rt<"bottom"iflp<"clear">>',
"bJQueryUI": false,
"bStateSave": false,
"oColVis": {
"buttonText": "Show / hide columns",
"bRestore": true,
"sAlign": "left"
},
"aaSorting": [ [11,'desc'] ],
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'20'+
'30'+
'40'+
'50'+
'All'+
' records'
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "<?php echo site_url() . '/filter/ajax_filter/' . $rig_id; ?>",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback,
"cache": false
});
}
});
$("thead input").keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, $("thead input").index(this) );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("thead input").each( function (i) {
asInitVals[i] = this.value;
} );
$("thead input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("thead input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("thead input").index(this)];
}
} );
[/code]
Cheers
Flakron
This discussion has been closed.