Function
Certification
Functionality
SPDropdownCtl was previously a private function I used in SPServices to find dropdown controls in the DOM. Because of the changes to the way title values are set in Office365 circa Jan 2104, it made sense to expose this as a public function. By making this a public function, it is my hope that it will help to smooth over any future changes to the way SharePoint renders this type of control in the DOM.
The function finds a dropdown in a form based on the name of the column (either the DisplayName or the StaticName) and returns an object you can use in your own functions.
Prerequisites
None
Syntax
$().SPServices.SPDropdownCtl({
displayName: ""
});
displayName
The DisplayName of the parent column in the form
Returns
The function returns a JavaScript object with information about the dropdown column. Depending upon the type of dropdown, the object will contain different values, like so:
If the column is a simple dropdown, the object will be:
{
Type: "S",
Obj: [reference to the select element for the dropdown]
}
For a complex dropdown:
{
Type: "C",
Obj: [reference to the input element for the dropdown]
}
For a multi-select "dropdown", as with a lookup column which allow multiple selections:
{
Type: "M",
Obj: [reference to the input element for the dropdown]
container: [reference to the containing span],
MultiLookupPickerdata,
master
}
Example
TBD