Skip to content
Open
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
46 changes: 24 additions & 22 deletions js/dataTables.cellEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,31 @@ jQuery.fn.dataTable.Api.register('MakeCellsEditable()', function (settings) {
if (table != null) {
// On cell click
$(table.body()).on('click', 'td', function () {

var currentColumnIndex = table.cell(this).index().column;

// DETERMINE WHAT COLUMNS CAN BE EDITED
if ((settings.columns && settings.columns.indexOf(currentColumnIndex) > -1) || (!settings.columns)) {
var row = table.row($(this).parents('tr'));
editableCellsRow = row;

var cell = table.cell(this).node();
var oldValue = table.cell(this).data();
// Sanitize value
oldValue = sanitizeCellValue(oldValue);

// Show input
if (!$(cell).find('input').length && !$(cell).find('select').length && !$(cell).find('textarea').length) {
// Input CSS
var input = getInputHtml(currentColumnIndex, settings, oldValue);
$(cell).html(input.html);
if (input.focus) {
$('#ejbeatycelledit').focus();
if (table.cell(this).index()) {
var currentColumnIndex = table.cell(this).index().column;

// DETERMINE WHAT COLUMNS CAN BE EDITED
if ((settings.columns && settings.columns.indexOf(currentColumnIndex) > -1) || (!settings.columns)) {
var row = table.row($(this).parents('tr'));
editableCellsRow = row;

var cell = table.cell(this).node();
var oldValue = table.cell(this).data();
// Sanitize value
oldValue = sanitizeCellValue(oldValue);

// Show input
if (!$(cell).find('input').length && !$(cell).find('select').length && !$(cell).find('textarea').length) {
// Input CSS
var input = getInputHtml(currentColumnIndex, settings, oldValue);
$(cell).html(input.html);
if (input.focus) {
$('#ejbeatycelledit').focus();
}
}
}
}
}
}
}
});
}

Expand Down