CheckboxGroup
Extends:
react-native~Component → CheckboxGroup
CheckboxGroup Component
Example:
<CheckboxGroup ref="CheckboxGroup1" name="group2" onSelect={(value) => {
}} primary={primary}>
<Checkbox value="1" label="Checkbox On" checked={true}/>
<Checkbox value="2" label="Checkbox Off"/>
<Checkbox value="3" label="Checkbox On Disabled" checked={true} disabled={true}/>
<Checkbox value="4" label="Checkbox Off Disabled" disabled={true}/>
<Checkbox value="5" checked={true}/>
<Checkbox value="6"/>
</CheckboxGroup>
<View style={[styles.content,styles.action]}>
<Text style={{flex:1}}>Selected {this.state.group2Selected.join(',')}</Text>
<Button raised={true} value="Press to select 1,2,6" onPress={()=>{this.refs.CheckboxGroup1.value = ['1','2','6']}} />
</View>
Constructor Summary
Public Constructor | ||
public |
constructor(props: object) |
Member Summary
Public Members | ||
public |
state: {selected: *[]} |
|
public get |
Get the value of checked Checkbox in CheckboxGroup. |
|
public set |
Make CheckboxGroup set some checkbox checked |
Public Constructors
public constructor(props: object) source
Params:
Name | Type | Attribute | Description |
props | object | ||
props.name | string | CheckboxGroup name. Often use in form |
|
props.theme | enum(THEME_NAME) |
|
Checkbox theme option |
props.primary | enum(COLOR_NAME) |
|
Checkbox primary color name. Specifies that which Checkbox should be pre-selected |
props.value | string[] |
|
A array save the values of checked Checkbox |
props.onSelect | function(value: string) |
|
When CheckboxGroup value change will trigger this function |