2

I have a selectize-ng input in my app:

<input type="text" selectize="usersSelect.options" options="users" ng-model="users.selected" />

My controller is

    $scope.users = [];

UsersWithRolesFactory.getUserRoleData().then(function(response) {
  $scope.users = response;
});

$scope.usersSelect = {
  options: {
    valueField: 'full_name',
    labelField: 'full_name',
    searchField: ['full_name'],
    plugins: ['remove_button']
  }
};

My (partial) json data is

[{"id":17,"full_name":"Janet Willis","selected":false,"merchant":"Geba","role":"Reviewer"},
{"id":18,"full_name":"Michelle Murphy","selected":false,"merchant":"Zazio","role":"Reviewer"},
{"id":19,"full_name":"Carol Gardner","selected":true,"merchant":"Skinte","role":"User"},
{"id":20,"full_name":"Laura Wallace","selected":false,"merchant":"Yacero","role":"User"}]

What I need to do is to display the users who are selected:true in the field, such as Carole Gardner here (entered by hand in the field):

enter image description here

How is this done?

Steve
  • 14,401
  • 35
  • 125
  • 230
  • Question answered at your duplicate: http://stackoverflow.com/questions/29352217/pre-fill-selectize-menu – PhiLho May 28 '15 at 12:44

0 Answers0