PrimeNG p-orderList disable multiple selection of items
I am using PrimeNG's p-orderList. By default, the metaKeySelection attribute is true which implies that a metaKey(ctrl key) is needed to be pressed to select multiple items. I was rather looking for a way to completely disable selection of multiple items. I should be able to select ONLY ONE item in the ordered list.
There is no metaKey attribute available for p-orderList. Can anyone help me with this?
<p-orderList [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
PS: onSelectionChange($event)
is triggered every time you select items from the ordered list. $event.value
contains the array of the items.
html angular primeng
add a comment |
I am using PrimeNG's p-orderList. By default, the metaKeySelection attribute is true which implies that a metaKey(ctrl key) is needed to be pressed to select multiple items. I was rather looking for a way to completely disable selection of multiple items. I should be able to select ONLY ONE item in the ordered list.
There is no metaKey attribute available for p-orderList. Can anyone help me with this?
<p-orderList [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
PS: onSelectionChange($event)
is triggered every time you select items from the ordered list. $event.value
contains the array of the items.
html angular primeng
1
Please correct your tagging! Read what all tags are and see which one you are actually not using
– Kukeltje
Nov 14 '18 at 9:34
add a comment |
I am using PrimeNG's p-orderList. By default, the metaKeySelection attribute is true which implies that a metaKey(ctrl key) is needed to be pressed to select multiple items. I was rather looking for a way to completely disable selection of multiple items. I should be able to select ONLY ONE item in the ordered list.
There is no metaKey attribute available for p-orderList. Can anyone help me with this?
<p-orderList [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
PS: onSelectionChange($event)
is triggered every time you select items from the ordered list. $event.value
contains the array of the items.
html angular primeng
I am using PrimeNG's p-orderList. By default, the metaKeySelection attribute is true which implies that a metaKey(ctrl key) is needed to be pressed to select multiple items. I was rather looking for a way to completely disable selection of multiple items. I should be able to select ONLY ONE item in the ordered list.
There is no metaKey attribute available for p-orderList. Can anyone help me with this?
<p-orderList [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
PS: onSelectionChange($event)
is triggered every time you select items from the ordered list. $event.value
contains the array of the items.
html angular primeng
html angular primeng
edited Nov 15 '18 at 7:59
Ashish Kamble
632519
632519
asked Nov 14 '18 at 6:23
Sourav PatraSourav Patra
63
63
1
Please correct your tagging! Read what all tags are and see which one you are actually not using
– Kukeltje
Nov 14 '18 at 9:34
add a comment |
1
Please correct your tagging! Read what all tags are and see which one you are actually not using
– Kukeltje
Nov 14 '18 at 9:34
1
1
Please correct your tagging! Read what all tags are and see which one you are actually not using
– Kukeltje
Nov 14 '18 at 9:34
Please correct your tagging! Read what all tags are and see which one you are actually not using
– Kukeltje
Nov 14 '18 at 9:34
add a comment |
1 Answer
1
active
oldest
votes
What about the metaKeySelection
input property? (as shown here)
<p-orderList [metaKeySelection]="false" [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
the [metaKeySelection] just enables toggling of one or more elements. If its true (which is by default), you will be able to select one item BUT need ctrl key to select multiple items. If metaKeySelection is false, you can select multiple items by default. I want to avoid that itself.
– Sourav Patra
Nov 16 '18 at 10:50
Mmm, i don't think you can achieve that, as you can see here: github.com/primefaces/primeng/blob/master/src/app/components/… orderlist handle ONLY multiple selection. You could try to extend the orderlist component and create your own one. stackoverflow.com/questions/44519015/…
– Dyd666
Nov 17 '18 at 20:22
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f53294232%2fprimeng-p-orderlist-disable-multiple-selection-of-items%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What about the metaKeySelection
input property? (as shown here)
<p-orderList [metaKeySelection]="false" [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
the [metaKeySelection] just enables toggling of one or more elements. If its true (which is by default), you will be able to select one item BUT need ctrl key to select multiple items. If metaKeySelection is false, you can select multiple items by default. I want to avoid that itself.
– Sourav Patra
Nov 16 '18 at 10:50
Mmm, i don't think you can achieve that, as you can see here: github.com/primefaces/primeng/blob/master/src/app/components/… orderlist handle ONLY multiple selection. You could try to extend the orderlist component and create your own one. stackoverflow.com/questions/44519015/…
– Dyd666
Nov 17 '18 at 20:22
add a comment |
What about the metaKeySelection
input property? (as shown here)
<p-orderList [metaKeySelection]="false" [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
the [metaKeySelection] just enables toggling of one or more elements. If its true (which is by default), you will be able to select one item BUT need ctrl key to select multiple items. If metaKeySelection is false, you can select multiple items by default. I want to avoid that itself.
– Sourav Patra
Nov 16 '18 at 10:50
Mmm, i don't think you can achieve that, as you can see here: github.com/primefaces/primeng/blob/master/src/app/components/… orderlist handle ONLY multiple selection. You could try to extend the orderlist component and create your own one. stackoverflow.com/questions/44519015/…
– Dyd666
Nov 17 '18 at 20:22
add a comment |
What about the metaKeySelection
input property? (as shown here)
<p-orderList [metaKeySelection]="false" [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
What about the metaKeySelection
input property? (as shown here)
<p-orderList [metaKeySelection]="false" [value]="policyList" [listStyle]="{'min-height':'calc(100vh - 325px)'}" (onSelectionChange)="onSelectionChange($event)">
<ng-template let-policy pTemplate="policy">
<span>{{policy}}</span>
</ng-template>
</p-orderList>
answered Nov 15 '18 at 8:12
Dyd666Dyd666
344316
344316
the [metaKeySelection] just enables toggling of one or more elements. If its true (which is by default), you will be able to select one item BUT need ctrl key to select multiple items. If metaKeySelection is false, you can select multiple items by default. I want to avoid that itself.
– Sourav Patra
Nov 16 '18 at 10:50
Mmm, i don't think you can achieve that, as you can see here: github.com/primefaces/primeng/blob/master/src/app/components/… orderlist handle ONLY multiple selection. You could try to extend the orderlist component and create your own one. stackoverflow.com/questions/44519015/…
– Dyd666
Nov 17 '18 at 20:22
add a comment |
the [metaKeySelection] just enables toggling of one or more elements. If its true (which is by default), you will be able to select one item BUT need ctrl key to select multiple items. If metaKeySelection is false, you can select multiple items by default. I want to avoid that itself.
– Sourav Patra
Nov 16 '18 at 10:50
Mmm, i don't think you can achieve that, as you can see here: github.com/primefaces/primeng/blob/master/src/app/components/… orderlist handle ONLY multiple selection. You could try to extend the orderlist component and create your own one. stackoverflow.com/questions/44519015/…
– Dyd666
Nov 17 '18 at 20:22
the [metaKeySelection] just enables toggling of one or more elements. If its true (which is by default), you will be able to select one item BUT need ctrl key to select multiple items. If metaKeySelection is false, you can select multiple items by default. I want to avoid that itself.
– Sourav Patra
Nov 16 '18 at 10:50
the [metaKeySelection] just enables toggling of one or more elements. If its true (which is by default), you will be able to select one item BUT need ctrl key to select multiple items. If metaKeySelection is false, you can select multiple items by default. I want to avoid that itself.
– Sourav Patra
Nov 16 '18 at 10:50
Mmm, i don't think you can achieve that, as you can see here: github.com/primefaces/primeng/blob/master/src/app/components/… orderlist handle ONLY multiple selection. You could try to extend the orderlist component and create your own one. stackoverflow.com/questions/44519015/…
– Dyd666
Nov 17 '18 at 20:22
Mmm, i don't think you can achieve that, as you can see here: github.com/primefaces/primeng/blob/master/src/app/components/… orderlist handle ONLY multiple selection. You could try to extend the orderlist component and create your own one. stackoverflow.com/questions/44519015/…
– Dyd666
Nov 17 '18 at 20:22
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f53294232%2fprimeng-p-orderlist-disable-multiple-selection-of-items%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
1
Please correct your tagging! Read what all tags are and see which one you are actually not using
– Kukeltje
Nov 14 '18 at 9:34