destroying or disabling already initialized keytable plugin.

destroying or disabling already initialized keytable plugin.

azhararmarazhararmar Posts: 6Questions: 0Answers: 0
edited May 2012 in KeyTable
hi,
i am using keytable plugin with jeditable and here is the code.

[code]
var keys = new KeyTable({
"table": document.getElementById('estEditTable'),
"datatable": estEditTable
});
keys.event.action( null, null, function (nCell) {
keys.block = true;
$(nCell).editable( function (sVal) {
var id = $(this).parent().attr('id');
var index = $(this).parent().find('td.focus').index();
console.log(id + ', ' + index + ', ' + sVal);
keys.block = false;
return sVal;
},
{
"onblur": 'submit',
"onreset": function()
{
setTimeout( function () {keys.block = false;}, 0);
}
});
setTimeout( function () { $(nCell).click(); }, 0 );
});
[/code]

on wake of click even i want to disable or destroy the keytable plugin. something like this.

[code]
$('#disable').click(function(){
//disable key table plugin
});
[/code]

and also similarly enable it.

is there a way i could do this?

thank you.

Replies

  • allanallan Posts: 63,488Questions: 1Answers: 10,467 Site admin
    KeyTable has a 'block' parameter which and be used to tell it to ignore key strokes - keys.block = true; for example. Then to enable input control again you'd just set it to false (you might need to set focus as well depending if focus is retained or not).

    Allan
This discussion has been closed.