jsbeans

jsbeans  1.0.0

jsbeans > jsbeans > jsbeans.Select
Search:
 
Filters

Class jsbeans.Select

A javascript Object with both static and instance methods

Constructor

jsbeans.Select ( [id] )
Parameters:
[id] <String> if provided it stores the Select Object for future use.

Methods

copy

static void copy ( source , destination , [options] )
Copy selected Options from {@param} source to {@param} destination.
Parameters:
source <String | DOM> the Select Object (or its id)
destination <String | DOM> the Select Object (or its id)
[options] <JSON>
order: boolean, // order both destination by text. Optional, default false.
orderDestination: boolean, // order only destination by text.
Returns: void

copyAll

static void copyAll ( source , destination , [options] )
Copy selected Options from {@param} source to {@param} destination.
Parameters:
source <String | DOM> the Select Object (or its id)
destination <String | DOM> the Select Object (or its id)
[options] <JSON>
order: boolean, // order destination by text. Optional, default false.
orderDestination: boolean, // order only destination by text.
Returns: void

filter

static void filter ( value , select )
Shows only Options of {@param} select whose text contains string {@param} value.
Parameters:
value <String>
select <String | DOM> the Select Object (or its id)
Returns: void

filterObjectCleaner

static void filterObjectCleaner ( )
As {@method} filter creates hidden selects, developer can purge all created ones calling this.
Please note that selects currently filtered may NOT be restored! Developer may need to clean filter's input before calling this;
jQuery sample: $("#filterInput").val("").keyup();
jsbeans.Select.filterObjectCleaner();
Returns: void

min

static Option min ( select )
Returns the lowest Options among {@param} select's Options by text using < operator.
Parameters:
select <String | DOM> the Select Object (or its id)
Returns: Option
object

move

static void move ( source , destination , [options] )
Copy selected Options from {@param} source to {@param} destination removing them from {@param} source.
Parameters:
source <String | DOM> the Select Object (or its id)
destination <String | DOM> the Select Object (or its id)
[options] <JSON>
order: boolean, // order both source and destination by text. Optional, default false.
orderSource: boolean, // order only source by text.
orderDestination: boolean, // order only destination by text.
Returns: void

moveAll

static void moveAll ( source , destination , [options] )
Copy all Options from {@param} source to {@param} destination removing them from {@param} source.
Parameters:
source <String | DOM> the Select Object (or its id)
destination <String | DOM> the Select Object (or its id)
[options] <JSON>
order: boolean, // order destination by text. Optional, default false.
orderDestination: boolean, // order only destination by text.
Returns: void

order

static void order ( [caseSensitive] )
Orders Select's Options by their text, not by value.
It calls the static method
Parameters:
[caseSensitive] <boolean> optional, false
Returns: void

removeSelected

static void removeSelected ( object )
Useful primarly in multiple selects, a way to delete Options.
Parameters:
object <String | DOM> the Select Object or its id
Returns: void

setDependant

void setDependant ( childId , [parentId] )
Filters Options of a second Select based on value of the selected option pf the first.
Second options are mapped using style class. See jsbeans.Select page for details and running sample.
Parameters:
childId <String>
[parentId] <String>
Returns: void


Copyright © 2016 Francesco Mele. All rights reserved.