Skip to content
New issue

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

Setting selection on multi-select #7

Open
kevinwwilson opened this issue May 18, 2015 · 1 comment
Open

Setting selection on multi-select #7

kevinwwilson opened this issue May 18, 2015 · 1 comment
Labels

Comments

@kevinwwilson
Copy link

When I try to set the selection on a multi-select, the only way that I can find to get the checkboxes to be correctly checked as well as the preselected items to show up in the box when the form renders is to set both the selection as well as meta information in the data. Is there a better way?

areas.controller("areaAddTypeController", ['$scope', '$state', function($scope, $state) {
....
    $scope.selection = [{id: 1, name: "Country"}];
    $scope.areaTypes = [{id: 1, name: "Country",_hsmeta: {selected:true}}, {id: 2, name: "Province"}, {id: 3, name: "Cluster"}];
....
}]);

tag:

<hierarchical-selector multi-select="true" data="areaTypes" on-selection-changed="updateItems(items)" selection="selection" />
@lukemurray lukemurray added the bug label Jul 2, 2015
@randdusing
Copy link

I'm facing this issue as well. I thought I'd be able just set the selection object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants