To highlight the radio button on expanding the panel in expansion panel
I have placed radio button inside each expansion-panel
of accordion
like this:
I want to highlight the ratio button on clicking particular expansion-panel and if i close the panel highlighting should go :
NOTE: I want to highlight the radio-button only on clicking the panel not on clicking the radio-button.
Stackblitz DEMO
angular angular-material angular6
add a comment |
I have placed radio button inside each expansion-panel
of accordion
like this:
I want to highlight the ratio button on clicking particular expansion-panel and if i close the panel highlighting should go :
NOTE: I want to highlight the radio-button only on clicking the panel not on clicking the radio-button.
Stackblitz DEMO
angular angular-material angular6
add a comment |
I have placed radio button inside each expansion-panel
of accordion
like this:
I want to highlight the ratio button on clicking particular expansion-panel and if i close the panel highlighting should go :
NOTE: I want to highlight the radio-button only on clicking the panel not on clicking the radio-button.
Stackblitz DEMO
angular angular-material angular6
I have placed radio button inside each expansion-panel
of accordion
like this:
I want to highlight the ratio button on clicking particular expansion-panel and if i close the panel highlighting should go :
NOTE: I want to highlight the radio-button only on clicking the panel not on clicking the radio-button.
Stackblitz DEMO
angular angular-material angular6
angular angular-material angular6
edited Nov 22 '18 at 10:05
Empty_Soul
asked Nov 22 '18 at 9:23
Empty_SoulEmpty_Soul
19711
19711
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Here is the pretty easier way to change the checkbox as panel status.
<mat-accordion>
<mat-expansion-panel #panel1>
<mat-expansion-panel-header >
<mat-panel-title>
<mat-radio-button [checked]="panel1.expanded">Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel2>>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel2.expanded"> Panel 2</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 2 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel3>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel3.expanded">Panel 3</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 3 comes here
</mat-expansion-panel>
</mat-accordion>
Working copy is here - https://stackblitz.com/edit/angular-uhuunt-flryaz
Once again thanks for answer..:)
– Empty_Soul
Nov 22 '18 at 10:12
add a comment |
Maybe you can try something like this ? I only added to the first one ...
<mat-expansion-panel>
<mat-expansion-panel-header >
<mat-panel-title (click)="ww.checked=!ww.checked" >
<mat-radio-button checked="false" #ww>Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
https://stackblitz.com/edit/angular-uhuunt-2r2pf3
But it is checking only for one panel, i want for each panel.
– Empty_Soul
Nov 22 '18 at 9:48
If click particular panel, only that panelsradio-button
as to behighlighted
not other panel's.
– Empty_Soul
Nov 22 '18 at 9:50
check it now, I updated the demo stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 9:59
Please read my question once..:)
– Empty_Soul
Nov 22 '18 at 10:00
1
here you go! stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 10:06
|
show 2 more comments
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%2f53427563%2fto-highlight-the-radio-button-on-expanding-the-panel-in-expansion-panel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is the pretty easier way to change the checkbox as panel status.
<mat-accordion>
<mat-expansion-panel #panel1>
<mat-expansion-panel-header >
<mat-panel-title>
<mat-radio-button [checked]="panel1.expanded">Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel2>>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel2.expanded"> Panel 2</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 2 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel3>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel3.expanded">Panel 3</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 3 comes here
</mat-expansion-panel>
</mat-accordion>
Working copy is here - https://stackblitz.com/edit/angular-uhuunt-flryaz
Once again thanks for answer..:)
– Empty_Soul
Nov 22 '18 at 10:12
add a comment |
Here is the pretty easier way to change the checkbox as panel status.
<mat-accordion>
<mat-expansion-panel #panel1>
<mat-expansion-panel-header >
<mat-panel-title>
<mat-radio-button [checked]="panel1.expanded">Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel2>>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel2.expanded"> Panel 2</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 2 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel3>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel3.expanded">Panel 3</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 3 comes here
</mat-expansion-panel>
</mat-accordion>
Working copy is here - https://stackblitz.com/edit/angular-uhuunt-flryaz
Once again thanks for answer..:)
– Empty_Soul
Nov 22 '18 at 10:12
add a comment |
Here is the pretty easier way to change the checkbox as panel status.
<mat-accordion>
<mat-expansion-panel #panel1>
<mat-expansion-panel-header >
<mat-panel-title>
<mat-radio-button [checked]="panel1.expanded">Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel2>>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel2.expanded"> Panel 2</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 2 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel3>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel3.expanded">Panel 3</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 3 comes here
</mat-expansion-panel>
</mat-accordion>
Working copy is here - https://stackblitz.com/edit/angular-uhuunt-flryaz
Here is the pretty easier way to change the checkbox as panel status.
<mat-accordion>
<mat-expansion-panel #panel1>
<mat-expansion-panel-header >
<mat-panel-title>
<mat-radio-button [checked]="panel1.expanded">Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel2>>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel2.expanded"> Panel 2</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 2 comes here
</mat-expansion-panel>
<mat-expansion-panel #panel3>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-radio-button [checked]="panel3.expanded">Panel 3</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 3 comes here
</mat-expansion-panel>
</mat-accordion>
Working copy is here - https://stackblitz.com/edit/angular-uhuunt-flryaz
answered Nov 22 '18 at 10:10
Sunil SinghSunil Singh
6,1672626
6,1672626
Once again thanks for answer..:)
– Empty_Soul
Nov 22 '18 at 10:12
add a comment |
Once again thanks for answer..:)
– Empty_Soul
Nov 22 '18 at 10:12
Once again thanks for answer..:)
– Empty_Soul
Nov 22 '18 at 10:12
Once again thanks for answer..:)
– Empty_Soul
Nov 22 '18 at 10:12
add a comment |
Maybe you can try something like this ? I only added to the first one ...
<mat-expansion-panel>
<mat-expansion-panel-header >
<mat-panel-title (click)="ww.checked=!ww.checked" >
<mat-radio-button checked="false" #ww>Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
https://stackblitz.com/edit/angular-uhuunt-2r2pf3
But it is checking only for one panel, i want for each panel.
– Empty_Soul
Nov 22 '18 at 9:48
If click particular panel, only that panelsradio-button
as to behighlighted
not other panel's.
– Empty_Soul
Nov 22 '18 at 9:50
check it now, I updated the demo stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 9:59
Please read my question once..:)
– Empty_Soul
Nov 22 '18 at 10:00
1
here you go! stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 10:06
|
show 2 more comments
Maybe you can try something like this ? I only added to the first one ...
<mat-expansion-panel>
<mat-expansion-panel-header >
<mat-panel-title (click)="ww.checked=!ww.checked" >
<mat-radio-button checked="false" #ww>Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
https://stackblitz.com/edit/angular-uhuunt-2r2pf3
But it is checking only for one panel, i want for each panel.
– Empty_Soul
Nov 22 '18 at 9:48
If click particular panel, only that panelsradio-button
as to behighlighted
not other panel's.
– Empty_Soul
Nov 22 '18 at 9:50
check it now, I updated the demo stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 9:59
Please read my question once..:)
– Empty_Soul
Nov 22 '18 at 10:00
1
here you go! stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 10:06
|
show 2 more comments
Maybe you can try something like this ? I only added to the first one ...
<mat-expansion-panel>
<mat-expansion-panel-header >
<mat-panel-title (click)="ww.checked=!ww.checked" >
<mat-radio-button checked="false" #ww>Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
https://stackblitz.com/edit/angular-uhuunt-2r2pf3
Maybe you can try something like this ? I only added to the first one ...
<mat-expansion-panel>
<mat-expansion-panel-header >
<mat-panel-title (click)="ww.checked=!ww.checked" >
<mat-radio-button checked="false" #ww>Panel 1</mat-radio-button>
</mat-panel-title>
</mat-expansion-panel-header>
Panel 1 comes here
</mat-expansion-panel>
https://stackblitz.com/edit/angular-uhuunt-2r2pf3
edited Nov 22 '18 at 9:50
answered Nov 22 '18 at 9:46
freepowderfreepowder
2796
2796
But it is checking only for one panel, i want for each panel.
– Empty_Soul
Nov 22 '18 at 9:48
If click particular panel, only that panelsradio-button
as to behighlighted
not other panel's.
– Empty_Soul
Nov 22 '18 at 9:50
check it now, I updated the demo stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 9:59
Please read my question once..:)
– Empty_Soul
Nov 22 '18 at 10:00
1
here you go! stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 10:06
|
show 2 more comments
But it is checking only for one panel, i want for each panel.
– Empty_Soul
Nov 22 '18 at 9:48
If click particular panel, only that panelsradio-button
as to behighlighted
not other panel's.
– Empty_Soul
Nov 22 '18 at 9:50
check it now, I updated the demo stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 9:59
Please read my question once..:)
– Empty_Soul
Nov 22 '18 at 10:00
1
here you go! stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 10:06
But it is checking only for one panel, i want for each panel.
– Empty_Soul
Nov 22 '18 at 9:48
But it is checking only for one panel, i want for each panel.
– Empty_Soul
Nov 22 '18 at 9:48
If click particular panel, only that panels
radio-button
as to be highlighted
not other panel's.– Empty_Soul
Nov 22 '18 at 9:50
If click particular panel, only that panels
radio-button
as to be highlighted
not other panel's.– Empty_Soul
Nov 22 '18 at 9:50
check it now, I updated the demo stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 9:59
check it now, I updated the demo stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 9:59
Please read my question once..:)
– Empty_Soul
Nov 22 '18 at 10:00
Please read my question once..:)
– Empty_Soul
Nov 22 '18 at 10:00
1
1
here you go! stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 10:06
here you go! stackblitz.com/edit/angular-uhuunt-2r2pf3
– freepowder
Nov 22 '18 at 10:06
|
show 2 more comments
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%2f53427563%2fto-highlight-the-radio-button-on-expanding-the-panel-in-expansion-panel%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