Toolbar changing icon dynamically

Hi,

We would like to change the icon on the pivot table toolbar dynamically. We create a custom icon as follows:

args.customToolbar.splice(0, 0, {

                    prefixIcon: 'e-pivotview-expand',

                    tooltipText: 'Expand/Collapse',

                    id: 'expandCollapse',

                    click: this.toolbarClicked.bind(this),

            });


When clicked, we change the prefixIcon as follows:

  args.item.properties.prefixIcon = " e-pivotview-expand ";

The icon does not change. We tried calling  pivotObj.refresh( ) or pivotObj.dataBind( ) without any results.


Any suggestion?


3 Replies

MM Manikandan Murugesan Syncfusion Team November 17, 2021 03:17 PM UTC

Hi Thierry, 
 
We have prepared a sample to update toolbar icons dynamically as per your requirement. Please find it from below link. 
 

Please let us know if you have any concerns. 
 
Regards, 
Manikandan 



TH Thierry November 17, 2021 07:47 PM UTC

Thank you - I will try that. Much appreciated



MM Manikandan Murugesan Syncfusion Team November 18, 2021 07:48 AM UTC

Hi Thierry, 
   
Please let us know if you have any other queries. We are always happy to assist you.  
   
Regards,  
Manikandan 


Loader.
Up arrow icon