Conditional Delete Buttom
Conditional Delete Buttom
I was able to set the DTTT_disabled class for the Delete Buttom depending on my data:
[code]
$('#dyntab').dataTable( {
'sDom': 'T,<\'llg\'l>,,<\'fnd\'f>rtip',
'aaData': aDataSet,
'aoColumns': [
{ 'mData': 'text'},
{ 'mData': 'Cnt', 'sClass': 'center'}
],
'oTableTools': {
'sRowSelect': 'single',
'aButtons': [
{ 'sExtends': 'editor_create', 'editor': editor },
{ 'sExtends': 'editor_edit', 'editor': editor },
{ 'sExtends': 'editor_remove', 'editor': editor }
]
}
} );
$('#dyntab tbody tr').live('click', function () {
var nTds = $('td', this);
if( !$('#ToolTables_dyntab_2').hasClass('DTTT_disabled') && $(nTds[1]).text()>0 )
$('#ToolTables_dyntab_2').addClass('DTTT_disabled')
} );
[/code]
How can I tell the Delete Buttom to fire only when enabled?
[code]
$('#dyntab').dataTable( {
'sDom': 'T,<\'llg\'l>,,<\'fnd\'f>rtip',
'aaData': aDataSet,
'aoColumns': [
{ 'mData': 'text'},
{ 'mData': 'Cnt', 'sClass': 'center'}
],
'oTableTools': {
'sRowSelect': 'single',
'aButtons': [
{ 'sExtends': 'editor_create', 'editor': editor },
{ 'sExtends': 'editor_edit', 'editor': editor },
{ 'sExtends': 'editor_remove', 'editor': editor }
]
}
} );
$('#dyntab tbody tr').live('click', function () {
var nTds = $('td', this);
if( !$('#ToolTables_dyntab_2').hasClass('DTTT_disabled') && $(nTds[1]).text()>0 )
$('#ToolTables_dyntab_2').addClass('DTTT_disabled')
} );
[/code]
How can I tell the Delete Buttom to fire only when enabled?
This discussion has been closed.