I have an input field in each row of my jquery datatable. I have to trigger an event on text change and enter press for each of these input fields.Am loading jquery datatable using serverside processing.Before without using the server side processing the input field events were working fine!.What causes the event to be silent now?
Events i used before ---
$('#txtQty').keydown(function (e) {
alert("keydown");
}
$('#txtQty').change(function () {
alert("Change");
}
same listeners i use after the serverside processing applied.
Jquery grid details- client side processing and adding input box~
@foreach (var item in Model)
{
<tr>
.
.
.
.
.
.
@if (item.Qty <= 0)
{
<td>
<input class="inputs" id="txtQty" type="text" [email protected] />
</td>
}
}
Serverside processing and input box applied on the go-
$('#grid').dataTable({
"bServerSide": true,
"sAjaxSource": "../myaction/AjaxHandler",
"bProcessing": true,
"scrollY": 385,
"scrollX": true,
"scrollCollapse": true,
"jQueryUI": true,
"bJQueryUI": true,
"sDom": 'lfrtip',
"aoColumns": [
{ "sName": "dfgdfg" },
{ "sName": "dfgdfg" },
{ "sName": "hhh" },
{
"sName": "Qty",
"mRender": function (sName) {
return '<input class="inputs" id="txtQty" type="text" value='+ sName +' />';
},
},
{ "sName": "Category" },
{ "sName": "Comment" }
],
"oLanguage": {
"sProcessing":'Processing.....'
}
});
txtQty, don't you? If so, replace$('#txtQty').keydownwith, for example,$('.inputs').keydown$(document).on('keydown', '.inputs', function(e)instead.