@@ -17,8 +17,20 @@ import {
1717} from 'react-native' ;
1818
1919import ModalDropdown from 'react-native-modal-dropdown' ;
20+ //import ModalDropdown from './ModalDropdown';
2021
2122const DEMO_OPTIONS_1 = [ 'option 1' , 'option 2' , 'option 3' , 'option 4' , 'option 5' , 'option 6' , 'option 7' , 'option 8' , 'option 9' ] ;
23+ const DEMO_OPTIONS_2 = [
24+ { "name" : "Rex" , "age" : 30 } ,
25+ { "name" : "Mary" , "age" : 25 } ,
26+ { "name" : "John" , "age" : 41 } ,
27+ { "name" : "Jim" , "age" : 22 } ,
28+ { "name" : "Susan" , "age" : 52 } ,
29+ { "name" : "Brent" , "age" : 33 } ,
30+ { "name" : "Alex" , "age" : 16 } ,
31+ { "name" : "Ian" , "age" : 20 } ,
32+ { "name" : "Phil" , "age" : 24 } ,
33+ ] ;
2234
2335class Demo extends Component {
2436 constructor ( props ) {
@@ -52,7 +64,7 @@ class Demo extends Component {
5264 < ModalDropdown style = { styles . dropdown_2 }
5365 textStyle = { styles . dropdown_2_text }
5466 dropdownStyle = { styles . dropdown_2_dropdown }
55- options = { DEMO_OPTIONS_1 }
67+ options = { DEMO_OPTIONS_2 }
5668 renderRow = { this . _dropdown_2_renderRow . bind ( this ) }
5769 renderSeparator = { ( sectionID , rowID , adjacentRowHighlighted ) => this . _dropdown_2_renderSeparator ( sectionID , rowID , adjacentRowHighlighted ) }
5870 />
@@ -127,7 +139,7 @@ class Demo extends Component {
127139 source = { icon }
128140 />
129141 < Text style = { [ styles . dropdown_2_row_text , highlighted && { color : 'mediumaquamarine' } ] } >
130- { rowData }
142+ { ` ${ rowData . name } ( ${ rowData . age } )` }
131143 </ Text >
132144 </ View >
133145 </ TouchableHighlight >
@@ -165,7 +177,8 @@ class Demo extends Component {
165177
166178 _dropdown_4_onSelect ( idx , value ) {
167179 // BUG: alert in a modal will auto dismiss and causes crash after reload and touch. @sohobloo 2016-12-1
168- alert ( `idx=${ idx } , value='${ value } '` ) ;
180+ //alert(`idx=${idx}, value='${value}'`);
181+ console . debug ( `idx=${ idx } , value='${ value } '` ) ;
169182 }
170183
171184 _dropdown_5_show ( ) {
0 commit comments