Whay can I not disable keys on click evet?
Whay can I not disable keys on click evet?
I'm not able to disable keys when click on button.
If I use it outside the click event the keytable is disabled....
See this test case: https://jsfiddle.net/supernova404/jg60we4o/209/
I want to disable keys when a surten button is clicked: .buttons-page-length
var table = $('#dynamicTableDetailChild').DataTable({
keys: true
});
$('.buttons-page-length').on('click', function(){
console.log('inside');
$('#dynamicTableDetailChild').DataTable().keys.disable();
//table.keys.disable();
});
This question has an accepted answers - jump to answer
Answers
When I click the pageLength button the keyTable extension is disabled. Maybe I'm not understanding the problem description. Please provide the exact steps to replicate the issue.
Kevin
I updated the test case to show the Keys enabled state in the click event.
https://jsfiddle.net/7bL8t4u2/
Kevin
I was expecting the blue border to disapear when it got disabled? The problem is that I can still copy from this cell. So when I for exaple open an editor window I still copy from the main table because the blue border is still active. I guess I have missunderstood something!?
Use
cell.blur()
to blur the focus from the table beforekeys.disable()
. Updated test case:https://jsfiddle.net/6oebd7yk/
Kevin
This is just perfect. Thanks alot!