The code below shows an example of getting items from a toolbar:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
changeColor: function (btn) { let children = btn.up('appMenu').items for (let i = 0; i < children.items.length; ++i) { let ele = children.items[i] ele.setStyle({ fontWeight: 'normal', backgroundColor: '#F6F6F6', }) } btn.setStyle({ fontWeight: 'bold', backgroundColor: '#5FA2DD', }); }, |
The code here gives a brief demonstration of how to change the backgroud color of buttons in a toolbar by iterating over the toolbar’s items .
I cannot find any method of getting items from extjs7.x document. Iterating over items is the only effective way. If anyone knows another way, please tell me in the comment.
END!