jQWidgets Forums

jQuery UI Widgets Forums Angular jqxRating in jqxTree

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 6 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxRating in jqxTree #105496

    John361
    Participant

    Hello,

    I would like to create a kind of quiz. So, I decided to add x jqxRating element in jqxTree element. When I added it, it is not showed but outside yes. Here the code :

    HTML:

    
    <jqxTree #treeReference [width]="'100%'" [height]="height">
        <ul>
            <li item-expanded="true">My node
                <ul>
                    <li>
                        My text
                        <jqxRating #myRating [auto-create]="true" [disabled]="true"></jqxRating>
                    </li>
                </ul>
            </li>
            ...
        </ul>
    </jqxTree>
    

    TS:

    
    @ViewChild('treeReference') myTree: jqxTreeComponent;
    @ViewChild('myRating') myRating: jqxRatingComponent;
    
    ngAfterViewInit() {
        this.myRating.createComponent({
            width: 350,
            height: 50,
            value: 3.87
        });
    }
    

    For the “ngAfterViewInit” method, when rating is outside the tree, it works. The tree shows only text. Can someone help me please ?

    jqxRating in jqxTree #105504

    Martin
    Participant

    Hello John361,

    You could use jqwidgets.createInstance() for creating the jqxRating component inside jqxTree.
    Please, take a look at the following Example.

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.