mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-08 15:13:10 -06:00
Added support for select2 control for using select2 instead of simple
select input.
This commit is contained in:
parent
d2897a334f
commit
8f733aabd0
@ -1274,5 +1274,21 @@
|
|||||||
return groups;
|
return groups;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Backform Select2 control.
|
||||||
|
*/
|
||||||
|
var Select2Control = Backform.Select2Control = Backform.SelectControl.extend({
|
||||||
|
render: function() {
|
||||||
|
Backform.SelectControl.prototype.render.apply(this, arguments);
|
||||||
|
|
||||||
|
var col = _.defaults(this.field.toJSON(), this.defaults)
|
||||||
|
/*
|
||||||
|
* Add empty option as Select2 requires any empty '<option><option>' for
|
||||||
|
* some of its functionality to work and initialize select2 control.
|
||||||
|
*/
|
||||||
|
this.$el.find("select").prepend($('<option></option>')).select2(col.select2);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
});
|
||||||
return Backform;
|
return Backform;
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user