mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-04 10:23:03 -05:00
Added support for on-demand loading of items in Select2. Fixes #5038.
This commit is contained in:
committed by
Akshay Joshi
parent
fc5287bd9f
commit
737f8375fb
@@ -883,6 +883,7 @@ define([
|
||||
select2_opts = _.extend({
|
||||
openOnEnter: false,
|
||||
multiple: false,
|
||||
onDemandLoad: true,
|
||||
}, self.defaults.select2,
|
||||
(col.select2 || {})
|
||||
),
|
||||
@@ -943,6 +944,12 @@ define([
|
||||
select2_opts['placeholder'] = '';
|
||||
}
|
||||
|
||||
if(select2_opts.onDemandLoad) {
|
||||
select2_opts.dataAdapter = $.fn.select2.amd.require('select2/onDemandDataAdapter');
|
||||
if(_.isUndefined(select2_opts.ajax)) {
|
||||
select2_opts.ajax = {};
|
||||
}
|
||||
}
|
||||
// Initialize select2 control.
|
||||
this.$sel = this.$select.select2(select2_opts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user