JQXWidget: jqxMenu doesn't like ngFor loop inside of it to populate context sensitive menu options?
up vote
0
down vote
favorite
I have a jqxmenu but the content is defined by a ngFor. With static information it renders as designed, but when i shift to a ngFor loop which is set dynamically, it doesnt seem to properly apply classes accordingly.
<jqxMenu #gridMenu [width]="240" [height]="'auto'" [mode]="'popup'" [autoOpenPopup]="false" [theme]="'context'">
<ul>
<li *ngFor="let toolbarItem in toolbar">
<i><span{{toolbarItem['text']}}</span></i>
</li>
</ul>
</jqxMenu>
I tried to do something like:
<jqxMenu #gridMenu [auto-create]="false">...</jqxMenu>
and then created a change detector:
@ViewChild("gridMenu") gridMenu: jqxMenuComponent;
ngOnChanges() {
this.gridMenu.createComponent();
}
This also seems to fail. I noticed it would not apply the JQX classes as it would normally, and similarly close on click. I find it odd. I was tempted to just programatically add them all, but i didnt want to create a hack to add/remove the items if there is an actual step I am just missing.
Is there something I can do such that it would render correctly? I also looked at the API (https://www.jqwidgets.com/angular-components-documentation/documentation/jqxmenu/angular-menu-getting-started.htm?search=) and also noticed that there was no redraw method either.
Is there a way to do this, or should I write additional code to add/remove the classes for non-hover and hover states and apply accordingly?
javascript angular jqxwidgets
add a comment |
up vote
0
down vote
favorite
I have a jqxmenu but the content is defined by a ngFor. With static information it renders as designed, but when i shift to a ngFor loop which is set dynamically, it doesnt seem to properly apply classes accordingly.
<jqxMenu #gridMenu [width]="240" [height]="'auto'" [mode]="'popup'" [autoOpenPopup]="false" [theme]="'context'">
<ul>
<li *ngFor="let toolbarItem in toolbar">
<i><span{{toolbarItem['text']}}</span></i>
</li>
</ul>
</jqxMenu>
I tried to do something like:
<jqxMenu #gridMenu [auto-create]="false">...</jqxMenu>
and then created a change detector:
@ViewChild("gridMenu") gridMenu: jqxMenuComponent;
ngOnChanges() {
this.gridMenu.createComponent();
}
This also seems to fail. I noticed it would not apply the JQX classes as it would normally, and similarly close on click. I find it odd. I was tempted to just programatically add them all, but i didnt want to create a hack to add/remove the items if there is an actual step I am just missing.
Is there something I can do such that it would render correctly? I also looked at the API (https://www.jqwidgets.com/angular-components-documentation/documentation/jqxmenu/angular-menu-getting-started.htm?search=) and also noticed that there was no redraw method either.
Is there a way to do this, or should I write additional code to add/remove the classes for non-hover and hover states and apply accordingly?
javascript angular jqxwidgets
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a jqxmenu but the content is defined by a ngFor. With static information it renders as designed, but when i shift to a ngFor loop which is set dynamically, it doesnt seem to properly apply classes accordingly.
<jqxMenu #gridMenu [width]="240" [height]="'auto'" [mode]="'popup'" [autoOpenPopup]="false" [theme]="'context'">
<ul>
<li *ngFor="let toolbarItem in toolbar">
<i><span{{toolbarItem['text']}}</span></i>
</li>
</ul>
</jqxMenu>
I tried to do something like:
<jqxMenu #gridMenu [auto-create]="false">...</jqxMenu>
and then created a change detector:
@ViewChild("gridMenu") gridMenu: jqxMenuComponent;
ngOnChanges() {
this.gridMenu.createComponent();
}
This also seems to fail. I noticed it would not apply the JQX classes as it would normally, and similarly close on click. I find it odd. I was tempted to just programatically add them all, but i didnt want to create a hack to add/remove the items if there is an actual step I am just missing.
Is there something I can do such that it would render correctly? I also looked at the API (https://www.jqwidgets.com/angular-components-documentation/documentation/jqxmenu/angular-menu-getting-started.htm?search=) and also noticed that there was no redraw method either.
Is there a way to do this, or should I write additional code to add/remove the classes for non-hover and hover states and apply accordingly?
javascript angular jqxwidgets
I have a jqxmenu but the content is defined by a ngFor. With static information it renders as designed, but when i shift to a ngFor loop which is set dynamically, it doesnt seem to properly apply classes accordingly.
<jqxMenu #gridMenu [width]="240" [height]="'auto'" [mode]="'popup'" [autoOpenPopup]="false" [theme]="'context'">
<ul>
<li *ngFor="let toolbarItem in toolbar">
<i><span{{toolbarItem['text']}}</span></i>
</li>
</ul>
</jqxMenu>
I tried to do something like:
<jqxMenu #gridMenu [auto-create]="false">...</jqxMenu>
and then created a change detector:
@ViewChild("gridMenu") gridMenu: jqxMenuComponent;
ngOnChanges() {
this.gridMenu.createComponent();
}
This also seems to fail. I noticed it would not apply the JQX classes as it would normally, and similarly close on click. I find it odd. I was tempted to just programatically add them all, but i didnt want to create a hack to add/remove the items if there is an actual step I am just missing.
Is there something I can do such that it would render correctly? I also looked at the API (https://www.jqwidgets.com/angular-components-documentation/documentation/jqxmenu/angular-menu-getting-started.htm?search=) and also noticed that there was no redraw method either.
Is there a way to do this, or should I write additional code to add/remove the classes for non-hover and hover states and apply accordingly?
javascript angular jqxwidgets
javascript angular jqxwidgets
asked Nov 19 at 21:17
Fallenreaper
3,88083179
3,88083179
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53382764%2fjqxwidget-jqxmenu-doesnt-like-ngfor-loop-inside-of-it-to-populate-context-sens%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