We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i hope can help someone if you want set value default from a existing resource you can this way how explin in documentation
const [countries, setCountries] = React.useState([ { id: '22946344-f6be-11ed-8207-9828a60f7a9e', name: 'node js'}, { id: '123456789', name: 'php'} ]);
const id = '22946344-f6be-11ed-8207-9828a60f7a9e';
countries.forEach(function(item){
if ( item.id == id ) { item.checked = true; }
});
setCountries(countries);
<Select2 style={{ borderRadius: 5, marginTop: 20 }} isSelectSingle cancelButtonText="Cancelar" selectButtonText="Aceptar" searchPlaceHolderText="Buscar" colorTheme={theme.colors.primary} popupTitle="Seleccione " title="Selecionar barrio" data={countries} onSelect={(data:any) => { setState(data) }} onRemoveItem={(data:any) => { setState(data) }} />
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i hope can help someone if you want set value default from a existing resource you can this way how explin in documentation
const [countries, setCountries] = React.useState([
{ id: '22946344-f6be-11ed-8207-9828a60f7a9e', name: 'node js'},
{ id: '123456789', name: 'php'}
]);
const id = '22946344-f6be-11ed-8207-9828a60f7a9e';
countries.forEach(function(item){
});
setCountries(countries);
<Select2
style={{ borderRadius: 5, marginTop: 20 }}
isSelectSingle
cancelButtonText="Cancelar"
selectButtonText="Aceptar"
searchPlaceHolderText="Buscar"
colorTheme={theme.colors.primary}
popupTitle="Seleccione "
title="Selecionar barrio"
data={countries}
onSelect={(data:any) => {
setState(data)
}}
onRemoveItem={(data:any) => {
setState(data)
}}
/>
The text was updated successfully, but these errors were encountered: