Skip to content Skip to sidebar Skip to footer

Check Item Icon In Sencha

I am new at Extjs and Sencha. i started to design my UI and i could successfully add an iconCls with buttons. now i need to add icon to a checkitem menue http://dev.sencha.com/depl

Solution 1:

If you just want the icon right next to the text, you can just insert an image after the menu item is rendered

Ext.create('Ext.menu.Menu', {
    width: 100,
    height: 200,
    floating: false, 
    renderTo: Ext.getBody(), 
    items: [{
        xtype: 'menucheckitem',
        text: 'select all',
        listeners: {
            render: function(comp) {
                Ext.DomHelper.insertAfter(comp.getEl().down(".x-menu-item-icon"), {
                    tag: 'img', 
                    src: "http://flyosity.com/images/_blogentries/networkicon/stepfinal2.png",
                    width: 16,
                    height: 16
                });
            }            
        }
    }]
});

Ideally, you'd create a plugin or a subclass so you can reuse this functionality. The above code does not realign the separator, it's single separator for the entire menu, but it should give you a head start

Post a Comment for "Check Item Icon In Sencha"