Trying to populate the multiselect with custom backendAdapter

We would like to not use any DataManager Adapter because we have a legacy BackendAdparter for all  API calls. The issue is that in this way the Multiselect never is populated. I let you a piece of example code. Thanks in advance.

import { listGroupsBackendAdapter} from 'services/backendAdapter';

interface UsersState {
groups: { [key: string]: Object }[];
permissions: { [key: string]: Object }[];
}
class User extends React.Component<UserPorps, UsersState> {
constructor(props: UserPorps) {
super(props);
this.state = {
groups: [],
permissions: []
};
}

componentWillMount() {
listGroupsBackendAdapter
.startCallNoRedux('get')
.then(response => {
this.setState({ groups: response });
});
}

public render() {
return (
<form id="inviteUserForm" ref={(ref) => this.formRef = ref} >
<div className="form-row">
<div className="col">
<label htmlFor="GroupsMultiSelect">Groups</label>
<MultiSelectComponent
id="GroupsMultiSelect"
placeholder="Groups"
mode="Box"
dataSource={this.state.groups}
fields={{ text: 'name', value: 'id' }}
change={this.setGroups}
/>
</div>
</div>
</form>  
);
}

}

}

3 Replies

PO Prince Oliver Syncfusion Team October 10, 2018 08:49 AM UTC

Hi Denny, 

Thank you for contacting Syncfusion support. 

We have prepared a MultiSelect sample to bind remote data service without using the dataManager. We were able to bind the data to the control. We have attached the sample for your reference, please find the sample at the following location: https://stackblitz.com/edit/react-n5k2w4-grjkjk  

Please check the above sample in your end and let us know if the issue is resolved in your end. if not, kindly modify the above sample to replicate the issue and send it back to us. It will help us provide solution. 

Regards, 
Prince 



DE Denny October 19, 2018 07:55 PM UTC

Thanks Prince 


PO Prince Oliver Syncfusion Team October 22, 2018 04:32 AM UTC

Hi Denny, 

Most welcome. We are glad to help you. 

Regards, 
Prince 


Loader.
Up arrow icon