Dynamically set the settings options for the ng-dropdown-multiselect
up vote
0
down vote
favorite
How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?
Check it out here:
http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview
view
<div ng-dropdown-multiselect=""
options="example65data"
selected-model="example65model"
extra-settings="example65settings"></div>
controller
$scope.example65model = [{id: 1}];
$scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
$scope.example65settings = {selectionLimit: 3};
$scope.updateMultiSelectLimit = function (){
$scope.example65settings = {selectionLimit: 2};
}
$scope.updateData = function(){
$scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
}
angularjs angularjs-directive ng-dropdown-multiselect
add a comment |
up vote
0
down vote
favorite
How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?
Check it out here:
http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview
view
<div ng-dropdown-multiselect=""
options="example65data"
selected-model="example65model"
extra-settings="example65settings"></div>
controller
$scope.example65model = [{id: 1}];
$scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
$scope.example65settings = {selectionLimit: 3};
$scope.updateMultiSelectLimit = function (){
$scope.example65settings = {selectionLimit: 2};
}
$scope.updateData = function(){
$scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
}
angularjs angularjs-directive ng-dropdown-multiselect
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?
Check it out here:
http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview
view
<div ng-dropdown-multiselect=""
options="example65data"
selected-model="example65model"
extra-settings="example65settings"></div>
controller
$scope.example65model = [{id: 1}];
$scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
$scope.example65settings = {selectionLimit: 3};
$scope.updateMultiSelectLimit = function (){
$scope.example65settings = {selectionLimit: 2};
}
$scope.updateData = function(){
$scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
}
angularjs angularjs-directive ng-dropdown-multiselect
How can I dynamically set the settings options for the ng-dropdown-multiselect, like setting the data, is this posible?
Check it out here:
http://plnkr.co/edit/ntVBcGRsD0HXgQoshBlp?p=preview
view
<div ng-dropdown-multiselect=""
options="example65data"
selected-model="example65model"
extra-settings="example65settings"></div>
controller
$scope.example65model = [{id: 1}];
$scope.example65data = [{id: 1, label: "David"}, {id: 2, label: "Jhon"}];
$scope.example65settings = {selectionLimit: 3};
$scope.updateMultiSelectLimit = function (){
$scope.example65settings = {selectionLimit: 2};
}
$scope.updateData = function(){
$scope.example65data = [{id: 1, label: "Peter"}, {id: 2, label: "Yiss"}, {id: 3, label: "Max"}];
}
angularjs angularjs-directive ng-dropdown-multiselect
angularjs angularjs-directive ng-dropdown-multiselect
asked Mar 24 '17 at 1:55
user021205
494
494
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
//HTML
<div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>
//JS
$scope.example65model= ;
function abc//Can Be Anything() {
var allData = hrmsService.getdata//Service Function Call();
allData.then(function (//Take any variable//pqr) {
DataObj = ;
for (var i in pqr.data) {
item = {}
item["id"] = pqr.data[i].Id//Primary Key;
item["label"] = apiSkills.data[i].Description//Any Description Field;
DataObj.push(item);
}
$scope.example65data= DataObj;
}, function () {
alert("Data Not Found");
});
}
add a comment |
up vote
0
down vote
Try this
//HTML
<div
ng-dropdown-multiselect=""
options="tabListdata"
selected-model="tabListmodel"
extra-settings="tabListsettings"
events="{ onSelectionChanged: getAllPolicies }"
>
</div>
//JS
$scope.tabListmodel = ;
$scope.tabListdata = [{
id: 1,
label: "Option 1"
}, {
id: 2,
label: "Option 2"
}, {
id: 3,
label: "Option 3"
}, {
id: 4,
label: "Option 4"
}, {
id: 5,
label: "Option 5"
}, {
id: 6,
label: "Option 6"
}];
$scope.tabListsettings = {
smartButtonMaxItems: 6,
smartButtonTextConverter: function (itemText, originalItem) {
return itemText;
}
};
$scope.getAllPolicies = function () {
console.log("$scope.tabListmodel", $scope.tabListmodel);
}
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
//HTML
<div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>
//JS
$scope.example65model= ;
function abc//Can Be Anything() {
var allData = hrmsService.getdata//Service Function Call();
allData.then(function (//Take any variable//pqr) {
DataObj = ;
for (var i in pqr.data) {
item = {}
item["id"] = pqr.data[i].Id//Primary Key;
item["label"] = apiSkills.data[i].Description//Any Description Field;
DataObj.push(item);
}
$scope.example65data= DataObj;
}, function () {
alert("Data Not Found");
});
}
add a comment |
up vote
0
down vote
//HTML
<div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>
//JS
$scope.example65model= ;
function abc//Can Be Anything() {
var allData = hrmsService.getdata//Service Function Call();
allData.then(function (//Take any variable//pqr) {
DataObj = ;
for (var i in pqr.data) {
item = {}
item["id"] = pqr.data[i].Id//Primary Key;
item["label"] = apiSkills.data[i].Description//Any Description Field;
DataObj.push(item);
}
$scope.example65data= DataObj;
}, function () {
alert("Data Not Found");
});
}
add a comment |
up vote
0
down vote
up vote
0
down vote
//HTML
<div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>
//JS
$scope.example65model= ;
function abc//Can Be Anything() {
var allData = hrmsService.getdata//Service Function Call();
allData.then(function (//Take any variable//pqr) {
DataObj = ;
for (var i in pqr.data) {
item = {}
item["id"] = pqr.data[i].Id//Primary Key;
item["label"] = apiSkills.data[i].Description//Any Description Field;
DataObj.push(item);
}
$scope.example65data= DataObj;
}, function () {
alert("Data Not Found");
});
}
//HTML
<div ng-dropdown-multiselect="example65data" id="xyz"//Can Be Anything options="example65data" selected-model="example65model"></div>
//JS
$scope.example65model= ;
function abc//Can Be Anything() {
var allData = hrmsService.getdata//Service Function Call();
allData.then(function (//Take any variable//pqr) {
DataObj = ;
for (var i in pqr.data) {
item = {}
item["id"] = pqr.data[i].Id//Primary Key;
item["label"] = apiSkills.data[i].Description//Any Description Field;
DataObj.push(item);
}
$scope.example65data= DataObj;
}, function () {
alert("Data Not Found");
});
}
edited Apr 11 '17 at 11:52
Lasse Sviland
1,081718
1,081718
answered Apr 11 '17 at 8:42
Aditya Shah
35
35
add a comment |
add a comment |
up vote
0
down vote
Try this
//HTML
<div
ng-dropdown-multiselect=""
options="tabListdata"
selected-model="tabListmodel"
extra-settings="tabListsettings"
events="{ onSelectionChanged: getAllPolicies }"
>
</div>
//JS
$scope.tabListmodel = ;
$scope.tabListdata = [{
id: 1,
label: "Option 1"
}, {
id: 2,
label: "Option 2"
}, {
id: 3,
label: "Option 3"
}, {
id: 4,
label: "Option 4"
}, {
id: 5,
label: "Option 5"
}, {
id: 6,
label: "Option 6"
}];
$scope.tabListsettings = {
smartButtonMaxItems: 6,
smartButtonTextConverter: function (itemText, originalItem) {
return itemText;
}
};
$scope.getAllPolicies = function () {
console.log("$scope.tabListmodel", $scope.tabListmodel);
}
add a comment |
up vote
0
down vote
Try this
//HTML
<div
ng-dropdown-multiselect=""
options="tabListdata"
selected-model="tabListmodel"
extra-settings="tabListsettings"
events="{ onSelectionChanged: getAllPolicies }"
>
</div>
//JS
$scope.tabListmodel = ;
$scope.tabListdata = [{
id: 1,
label: "Option 1"
}, {
id: 2,
label: "Option 2"
}, {
id: 3,
label: "Option 3"
}, {
id: 4,
label: "Option 4"
}, {
id: 5,
label: "Option 5"
}, {
id: 6,
label: "Option 6"
}];
$scope.tabListsettings = {
smartButtonMaxItems: 6,
smartButtonTextConverter: function (itemText, originalItem) {
return itemText;
}
};
$scope.getAllPolicies = function () {
console.log("$scope.tabListmodel", $scope.tabListmodel);
}
add a comment |
up vote
0
down vote
up vote
0
down vote
Try this
//HTML
<div
ng-dropdown-multiselect=""
options="tabListdata"
selected-model="tabListmodel"
extra-settings="tabListsettings"
events="{ onSelectionChanged: getAllPolicies }"
>
</div>
//JS
$scope.tabListmodel = ;
$scope.tabListdata = [{
id: 1,
label: "Option 1"
}, {
id: 2,
label: "Option 2"
}, {
id: 3,
label: "Option 3"
}, {
id: 4,
label: "Option 4"
}, {
id: 5,
label: "Option 5"
}, {
id: 6,
label: "Option 6"
}];
$scope.tabListsettings = {
smartButtonMaxItems: 6,
smartButtonTextConverter: function (itemText, originalItem) {
return itemText;
}
};
$scope.getAllPolicies = function () {
console.log("$scope.tabListmodel", $scope.tabListmodel);
}
Try this
//HTML
<div
ng-dropdown-multiselect=""
options="tabListdata"
selected-model="tabListmodel"
extra-settings="tabListsettings"
events="{ onSelectionChanged: getAllPolicies }"
>
</div>
//JS
$scope.tabListmodel = ;
$scope.tabListdata = [{
id: 1,
label: "Option 1"
}, {
id: 2,
label: "Option 2"
}, {
id: 3,
label: "Option 3"
}, {
id: 4,
label: "Option 4"
}, {
id: 5,
label: "Option 5"
}, {
id: 6,
label: "Option 6"
}];
$scope.tabListsettings = {
smartButtonMaxItems: 6,
smartButtonTextConverter: function (itemText, originalItem) {
return itemText;
}
};
$scope.getAllPolicies = function () {
console.log("$scope.tabListmodel", $scope.tabListmodel);
}
answered yesterday
Atul Baldaniya
146
146
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42990100%2fdynamically-set-the-settings-options-for-the-ng-dropdown-multiselect%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown