Added support for prepend as a function
This commit is contained in:
@ -163,7 +163,10 @@ List - abstract class for inputs that have source option loaded from js array or
|
|||||||
if (typeof this.options.prepend === 'string') {
|
if (typeof this.options.prepend === 'string') {
|
||||||
this.options.prepend = {'': this.options.prepend};
|
this.options.prepend = {'': this.options.prepend};
|
||||||
}
|
}
|
||||||
this.prependData = this.makeArray(this.options.prepend);
|
if (typeof this.options.prepend === 'function')
|
||||||
|
this.prependData = this.makeArray(this.options.prepend());
|
||||||
|
else
|
||||||
|
this.prependData = this.makeArray(this.options.prepend);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($.isArray(this.prependData) && $.isArray(this.sourceData)) {
|
if($.isArray(this.prependData) && $.isArray(this.sourceData)) {
|
||||||
@ -257,7 +260,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
|||||||
Data automatically prepended to the beginning of dropdown list.
|
Data automatically prepended to the beginning of dropdown list.
|
||||||
|
|
||||||
@property prepend
|
@property prepend
|
||||||
@type string|array|object
|
@type string|array|object|function
|
||||||
@default false
|
@default false
|
||||||
**/
|
**/
|
||||||
prepend:false,
|
prepend:false,
|
||||||
|
Reference in New Issue
Block a user