Skip to content

For select element implement import data and create options (from Object or Array)

Notifications You must be signed in to change notification settings

chemix/MooTools.Select.importOptions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MooTools-Select.importData

Simple way to add new options to select element

Screenshot

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

About

For select element implement import data and create options (from Object or Array)

Resources

Stars

Watchers

Forks

Packages

No packages published