Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ public function run()
$this->getView()->registerJs(
<<<JS
(function() {
var params = ${encodedParams};
var params = {$encodedParams};
var table;
${globalVariable} table = jQuery("#${id}").DataTable(params);
{$globalVariable} table = jQuery("#{$id}").DataTable(params);
var filterRow = jQuery('<tr></tr>');
jQuery('#${id} thead tr th').each(function(i)
jQuery('#{$id} thead tr th').each(function(i)
{
var cell = jQuery('<td></td>')
.attr('colspan', jQuery(this).attr('colspan'))
Expand All @@ -266,8 +266,8 @@ public function run()
cell.html(jQuery.isFunction(params.columns[i].renderFilter) ? params.columns[i].renderFilter(table) : params.columns[i].renderFilter);
}
});
jQuery('#${id} thead').append(filterRow);
jQuery('#${id} thead tr:eq(1) td').each( function (i)
jQuery('#{$id} thead').append(filterRow);
jQuery('#{$id} thead tr:eq(1) td').each( function (i)
{
jQuery(':input', this).on('keyup change', function () {
if (table.column(i).search() !== jQuery(this).val()) {
Expand Down