Fix an issue where debugger not showing all arguments anymore after hitting SQL error while debugging. Fixes #5101

Added a "Clear All" button to the argument dialog which will clear all the saved arguments values from SQLite DB.
This commit is contained in:
Aditya Toshniwal
2020-02-28 15:27:01 +05:30
committed by Akshay Joshi
parent c9d04684ce
commit 4db0a6524d
7 changed files with 195 additions and 14 deletions

View File

@@ -1916,6 +1916,58 @@ define([
},
});
Backgrid.BooleanCell = Backgrid.BooleanCell.extend({
className: 'boolean-cell',
enterEditMode: function() {
this.$el.addClass('editor');
$(this.$el.find('input[type=checkbox]')).trigger('focus');
},
exitEditMode: function() {
this.$el.removeClass('editor');
},
events: {
'change input': 'onChange',
'blur input': 'exitEditMode',
'keydown': 'onKeyDown',
},
onChange: function(e) {
var model = this.model,
column = this.column,
val = this.formatter.toRaw(this.$input.prop('checked'), model);
this.enterEditMode();
// on bootstrap change we also need to change model's value
model.set(column.get('name'), val);
model.trigger('backgrid:edited', model, column, new Backgrid.Command(e));
},
render: function () {
this.$el.empty();
var model = this.model, column = this.column;
var editable = Backgrid.callByNeed(column.editable(), column, model);
var align_center = column.get('align_center') || false;
let checked = this.formatter.fromRaw(model.get(column.get('name')), model);
let id = `column.get('name')_${_.uniqueId()}`;
this.$el.empty();
this.$el.append(
$(`<div class="custom-control custom-checkbox custom-checkbox-no-label ${align_center?'text-center':''}">
<input tabindex="0" type="checkbox" class="custom-control-input" id="${id}" ${!editable?'disabled':''} ${checked?'checked':''}/>
<label class="custom-control-label" for="${id}">
<span class="sr-only">Select<span>
</label>
</div>`)
);
this.$input = this.$el.find('input');
this.delegateEvents();
return this;
},
});
return Backgrid;
});