Select.importOptions 1.3

Simple way to add new options to select element



Details

Author
chemiX
Current version
1.3
GitHub
chemix/MooTools.Select.importOptions
Downloads
7233
Category
Native
Tags
Report
GitHub Issues

Releases


Dependencies

  • core/1.3: Hash

How to use

importOptions() & refreshOptions()

Syntax

data_01 = {
    'value1':'text desc 1',
    'valeu2':'text desc 2',
    'value3': {
                'selected':'selected',
                'rel':'addRel3',
                'value':'CustomValue3SkipIndex',
                'text':'Text3',
                'id':'optId3'
                },
    'value4':'text desc 4'

}
data_02 = ['text0', 'text1', 'text2']
$('MY_Select_ID').importOptions(data_01);
$('MY_Select_ID').importOptions(data_02);

// or Refresh - keep selected previous choice
$('MY_Select_ID').refreshOptions(data_01);
$('MY_Select_ID').refreshOptions(data_02);

Arguments

  1. data: (object,array) Source data

Demo

http://mootools.net/shell/4DmYx/1/


Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus