Skip to content

Commit

Permalink
Fix inline edit default value in <select>.
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-janu authored and paveljanda committed Dec 1, 2020
1 parent ad1fe55 commit 10e3751
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions assets/datagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,7 @@ $(document).on('click', '[data-datagrid-editable-url]', function(event) {
input.attr('rows', Math.round(cell_lines));
} else if (cell.data('datagrid-editable-type') === 'select') {
input = $(cell.data('datagrid-editable-element'));
input.find('option').each(function() {
if ($(this).val() === valueToEdit) {
return input.find("option[value='" + valueToEdit + "']").prop('selected', true);
}
});
input.find("option[value='" + valueToEdit + "']").prop('selected', true);
} else {
input = $('<input type="' + cell.data('datagrid-editable-type') + '">');
input.val(valueToEdit);
Expand Down

0 comments on commit 10e3751

Please sign in to comment.