Skip to content

Commit

Permalink
datalist - bug fix show old value
Browse files Browse the repository at this point in the history
  • Loading branch information
gagan-bansal committed Oct 4, 2019
1 parent 0d05bab commit 7a695f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/dataTables.cellEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ function getInputHtml(currentColumnIndex, settings, oldValue) {
startWrapperHtml = '<div>'
endWrapperHtml = '</div>'
}
input.html = startWrapperHtml + "<input list='datalist-" + currentColumnIndex + "' class='" + inputCss + "' onchange='$(this).updateEditableCell(this);'>";
input.html = startWrapperHtml + "<input list='datalist-" + currentColumnIndex + "' class='" + inputCss + "' value='" + oldValue + "' onchange='$(this).updateEditableCell(this);'>";
input.html = input.html + "</input>";
input.html = input.html + "<datalist id='datalist-" + currentColumnIndex + "'>";

$.each(inputSetting.options, function (index, option) {
if (oldValue == option.value) {
input.html = input.html + "<option value='" + option.value + "' selected>"
input.html = input.html + "<option value='" + option.value + "'>"
} else {
input.html = input.html + "<option value='" + option.value + "' >"
}
Expand All @@ -208,7 +208,7 @@ function getInputHtml(currentColumnIndex, settings, oldValue) {
startWrapperHtml = '<div>'
endWrapperHtml = '</div>'
}
input.html = startWrapperHtml + "<input list='datalist-" + currentColumnIndex + "' class='" + inputCss + "'>";
input.html = startWrapperHtml + "<input list='datalist-" + currentColumnIndex + "' class='" + inputCss + "' value='" + oldValue + "'>";
input.html = input.html + "</input>";
input.html = input.html + "<datalist id='datalist-" + currentColumnIndex + "'>";

Expand Down

0 comments on commit 7a695f6

Please sign in to comment.