Backspace key not working to clear search filter
Backspace key not working to clear search filter
semmelbroesel
Posts: 8Questions: 1Answers: 0
Hi.
I'm not sure what I'm missing here, but in my application, entering text into the search field seems to disable the backspace key - I can't delete the content of the search field unless I select the content or move the cursor and use the Delete key instead.
I use jquery Dialog to display the table in:
<div id="dialog"></div>
My included file versions:
<link href="/common/jquery-ui/css/smoothness/jquery-ui-1.9.1.custom.min.css" rel="stylesheet">
<link href="/common/dataTables/css/jquery.dataTables.min.css" rel="stylesheet">
<script src="/common/jquery-ui/js/jquery-ui-1.9.1.custom.min.js"></script>
<script src="/common/js/jquery.dataTables.min.js"></script>
My js code is as follows:
var $dialog; // holds dialog box
$(function()
{
$dialog = $('#dialog');
if ($dialog.length == 0)
{
$('#MainContent').append('<div id="dialog"></div>');
$dialog = $('#dialog');
}
// init dialog box
$dialog.dialog({
title: 'Family Selector',
minWidth: 600,
height: 'auto',
position: { my: "center top", at: "center top", of: window },
modal: true,
autoOpen: false,
open: function(event, ui) {
$('.ui-widget-overlay').bind('click', function(){ $dialog.dialog('close'); });
}
});
});
function OpenFamilySelector() // open dialog box with ajax driven list of families
{
$dialog.empty().html('<table id="famTable" cellspacing="0" width="100%"><thead><tr><th>Select</th><th>Family ID</th><th>First Name</th><th>Last Name</th></tr></thead><tfoot><tr><th>Select</th><th>Family ID</th><th>First Name</th><th>Last Name</th></tr></tfoot></table>');
$dialog.dialog('open');
$('#famTable').dataTable({
"ajax": '/ajax.php?act=fl',
"columnDefs": [
{
"render": function (data, type, row)
{
return '<input type="checkbox" class="fchk" value="' + row[1] + '">';
},
"orderable": false,
"targets": 0
}
],
"order": [[1, "asc"]]
});
}
I have no idea what could cause the backspace key to malfunction here...
Thoughts?
Thanks!
This discussion has been closed.
Answers
Oh, if I add another text field right after the table, that text field does allow the backspace key, so it seems likely that it has something to do with datatables and not with dialog as I originally thought...
Gah, so sorry - please delete this topic as I am apparently an idiot...
I had some old code still hidden on the page that prevented the backspace key from being used in certain situations...
Again, my apologies.
Heh - no worries. Good to hear you got it sorted out.
Will leave it here for anyone else that searches for the same issue. My Visual Event tool can be useful for debugging this kind of thing. I understand the latest Firebug dev tools also have something similar.
Allan
Yes, I found it through the Firebug tools.