Skip to content

Commit 667373f

Browse files
committed
when editing or inserting row, uncheck null checkbox if input value is not empty
1 parent 8620b34 commit 667373f

File tree

3 files changed

+382
-344
lines changed

3 files changed

+382
-344
lines changed

assets/js/insert_or_edit_row.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$(document).ready(function () {
2+
3+
jQuery('.insert_row_input').on('change blur', function () {
4+
var tr = $(this).closest('tr'),
5+
checkbox = tr.find('.nullcheckbox');
6+
7+
if ($(this).val() !== '') {
8+
checkbox.prop('checked', false);
9+
}
10+
11+
});
12+
13+
jQuery('input[type=submit]').on('mouseover', function () {
14+
jQuery('.insert_row_input').each(function () {
15+
var tr = $(this).closest('tr'),
16+
checkbox = tr.find('.nullcheckbox');
17+
18+
if ($(this).val() !== '') {
19+
checkbox.prop('checked', false);
20+
}
21+
});
22+
});
23+
24+
25+
});

0 commit comments

Comments
 (0)