bSort, bSortable and 'mousedown' event
bSort, bSortable and 'mousedown' event
i use DataTables 1.7.0...my table initialize so:
[code]
oTable = $('#table').dataTable(
{
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": url,
"bSortClasses": false,
"aoColumns":
[
/* th1 */ { "bSortable": false},
/* th2 */ { "bSortable": false},
/* th3 */ { "bSortable": false}
]
})
[/code]
and my html(with individual column filtering):
[code]
TH1 name
TH2 name
TH3 name
[/code]
i found some strange - when i right click on input in head(Mozilla 3.6.8) focus and blur not work!.....but in IE8 it`s work!...
I used Visual Event and have seen what DataTables add on th 'mousedown' event in _fnDrawHead function...
[code]
/*
* Function: _fnDrawHead
* Purpose: Create the HTML header for the table
* Returns: -
* Inputs: object:oSettings - dataTables settings object
*/
function _fnDrawHead( oSettings )
{
/* some code */
/* Take the brutal approach to cancelling text selection in header */
$('th', oSettings.nTHead).mousedown( function (e) {
this.onselectstart = function() { return false; };
return false;
}
[/code]
It happens when variable "bSort" is true....when i read this:
"bSort - Enable or disable sorting of columns. Sorting of individual columns can be disabled by the "bSortable" option for each column."
But after all all my columns have parameter bSortable!....why DataTables all the same add this event?...
this is very starnge...maybe default for bSort must be false?....
[code]
oTable = $('#table').dataTable(
{
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": url,
"bSortClasses": false,
"aoColumns":
[
/* th1 */ { "bSortable": false},
/* th2 */ { "bSortable": false},
/* th3 */ { "bSortable": false}
]
})
[/code]
and my html(with individual column filtering):
[code]
TH1 name
TH2 name
TH3 name
[/code]
i found some strange - when i right click on input in head(Mozilla 3.6.8) focus and blur not work!.....but in IE8 it`s work!...
I used Visual Event and have seen what DataTables add on th 'mousedown' event in _fnDrawHead function...
[code]
/*
* Function: _fnDrawHead
* Purpose: Create the HTML header for the table
* Returns: -
* Inputs: object:oSettings - dataTables settings object
*/
function _fnDrawHead( oSettings )
{
/* some code */
/* Take the brutal approach to cancelling text selection in header */
$('th', oSettings.nTHead).mousedown( function (e) {
this.onselectstart = function() { return false; };
return false;
}
[/code]
It happens when variable "bSort" is true....when i read this:
"bSort - Enable or disable sorting of columns. Sorting of individual columns can be disabled by the "bSortable" option for each column."
But after all all my columns have parameter bSortable!....why DataTables all the same add this event?...
this is very starnge...maybe default for bSort must be false?....
This discussion has been closed.
Replies
[code]
/* Take the brutal approach to cancelling text selection in header */
$('th', oSettings.nTHead).mousedown( function (e) {
this.onselectstart = function() { return false; };
return false;
} );
[/code]
Should come just after the call to _fnSortAttachListener() a few lines before (in that 'if' block). That should take care of that. This will be in the next release.
Regards,
Allan
[code]
/* Add sort listener */
if ( oSettings.oFeatures.bSort )
{
for ( i=0 ; i
Regards,
Allan