| Server IP : 162.214.74.102 / Your IP : 216.73.216.192 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/team/assets/js/selectboxit/js/modules/ |
Upload File : |
// Remove Options Module
// =====================
// remove
// ------
// Removes drop down list options
// using an index
selectBoxIt.remove = function(indexes, callback) {
var self = this,
dataType = $.type(indexes),
value,
x = 0,
dataLength,
elems = "";
// If an array is passed in
if(dataType === "array") {
// Loops through the array
for(dataLength = indexes.length; x <= dataLength - 1; x += 1) {
// Stores the currently traversed array item in the local `value` variable
value = indexes[x];
// If the currently traversed array item is an object literal
if($.type(value) === "number") {
if(elems.length) {
// Adds an element to the removal string
elems += ", option:eq(" + value + ")";
}
else {
// Adds an element to the removal string
elems += "option:eq(" + value + ")";
}
}
}
// Removes all of the appropriate options from the select box
self.selectBox.find(elems).remove();
}
// If a number is passed in
else if(dataType === "number") {
self.selectBox.find("option").eq(indexes).remove();
}
// If anything besides a number or array is passed in
else {
// Removes all of the options from the original select box
self.selectBox.find("option").remove();
}
// If the dropdown property exists
if(self.dropdown) {
// Rebuilds the dropdown
self.refresh(function() {
// Provide callback function support
self._callbackSupport(callback);
}, true);
} else {
// Provide callback function support
self._callbackSupport(callback);
}
// Maintains chainability
return self;
};