More grid filter improvements; add choice/enum/date value renderers.
This commit is contained in:
parent
226ca01720
commit
c9b01f6061
2 changed files with 64 additions and 9 deletions
19
tailbone/static/js/jquery.ui.tailbone.js
vendored
19
tailbone/static/js/jquery.ui.tailbone.js
vendored
|
@ -250,6 +250,18 @@
|
|||
}
|
||||
});
|
||||
|
||||
// Enhance any date values with datepicker widget.
|
||||
this.inputs.find('.value input[type="date"]').datepicker({
|
||||
dateFormat: 'yy-mm-dd',
|
||||
changeYear: true,
|
||||
changeMonth: true
|
||||
});
|
||||
|
||||
// Enhance any choice/dropdown values with selectmenu.
|
||||
this.inputs.find('.value select').selectmenu({
|
||||
width: '15em'
|
||||
});
|
||||
|
||||
// Listen for button click, to keep checkbox in sync.
|
||||
this._on(this.activebutton, {
|
||||
click: function(e) {
|
||||
|
@ -269,6 +281,11 @@
|
|||
refresh: function() {
|
||||
if (this.checkbox.is(':checked')) {
|
||||
this.activebutton.button('option', 'icons', {primary: 'ui-icon-check'});
|
||||
if (this.verb() in this.valueless_verbs) {
|
||||
this.inputs.find('.value').hide();
|
||||
} else {
|
||||
this.inputs.find('.value').show();
|
||||
}
|
||||
this.inputs.show();
|
||||
} else {
|
||||
this.activebutton.button('option', 'icons', {primary: 'ui-icon-blank'});
|
||||
|
@ -312,7 +329,7 @@
|
|||
},
|
||||
|
||||
value: function() {
|
||||
return this.inputs.find('.value input').val();
|
||||
return this.inputs.find('.value input, .value select').val();
|
||||
},
|
||||
|
||||
verb: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue