Wijmo treeview image size

Posted by: mark.nebrat on 31 May 2019, 9:50 am EST

    • Post Options:
    • Link

    Posted 31 May 2019, 9:50 am EST

    Hello

    With imageMemberPath property i can specify some image.

    How can i format it - set width,height and other img properties

    Thanks

  • Posted 3 June 2019, 4:27 am EST

    Hi,

    If you need to only style the img, then you could use CSS to style the image. Please refer to the following code snippet:

    .wj-treeview .wj-node img{
    	width: 25px;
    	height: 25px;
    }
    

    However, if you need to perform some advanced operation such as adding event listeners on the image then you could use the formatItem event to get the instance of the rendered image element and perform the required operations. In the formatItem event, the node element is passed as event data which contains the image element from imageMemberPath. Please refer to the sample below which demonstrates the use of formatItem:

    https://stackblitz.com/edit/js-ce8j6l

    API Reference:

    • formatItem: https://www.grapecity.com/wijmo/api/classes/wijmo_nav.treeview.html#formatitem

    • FormatNodeEventArgs: https://www.grapecity.com/wijmo/api/classes/wijmo_nav.formatnodeeventargs.html

    Regards

  • Posted 3 June 2019, 4:00 pm EST

    Thank you very much

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels