Jump to content

ImageIndex TreeView


masterdeveloper

Recommended Posts

We have an application that uses the mainModule theme "uni_mac_yosemite", I am developing a form where I need to change the images of the items of a UNITreeView, but using this theme it was not possible to set the imageindex, since using the default theme works normally, however I can not change the theme because the whole application already uses this format.

 

 

Has anyone had this problem and could it help me, whether it has change directly in the source with some property or configuration or if just adding the treatment via JS?

Link to comment
Share on other sites

uni-1.0.0.1410

 

UniTreeView -> ClientEvents -> ExtEvents -> Ext.data.TreeStore[store] -> function store.update:

function store.update(sender, record, operation, modifiedFieldNames, eOpts)
{
    var tree=this.treePanel;
    Ext.defer(function(){
        tree.el.select('.x-tree-icon').elements.forEach(function(el){
            var _s=el.style['background-image'];
            if (_s!=''){
                el.setAttribute('style', 'background-image:'+_s+' !important')
            }
        });
        tree.el.select('.x-tree-icon-parent').elements.forEach(function(el){
            var _s=el.style['background-image'];
            if (_s!=''){
                el.setAttribute('style', 'background-image:'+_s+' !important')
            }
        });
    }, 25);
}
Link to comment
Share on other sites

 

UniTreeView -> ClientEvents -> ExtEvents -> Ext.data.TreeStore[store] -> function store.update:

function store.update(sender, record, operation, modifiedFieldNames, eOpts)
{
    var tree=this.treePanel;
    Ext.defer(function(){
        tree.el.select('.x-tree-icon').elements.forEach(function(el){
            var _s=el.style['background-image'];
            if (_s!=''){
                el.setAttribute('style', 'background-image:'+_s+' !important')
            }
        });
        tree.el.select('.x-tree-icon-parent').elements.forEach(function(el){
            var _s=el.style['background-image'];
            if (_s!=''){
                el.setAttribute('style', 'background-image:'+_s+' !important')
            }
        });
    }, 25);
}

 

thank you so much :)
Link to comment
Share on other sites

  • 1 year later...

I had the same problem with TUniMenuItem.
I am trying to change the image (ImageIndex) of a TUniMenuItem from a TUniPopupMenu but in the TUniMenuButton does not refresh the image ... it is only the default defined ... I want to show the option that was clicked ...
how would that be?

 

I'm using Version 1.10.0.1466

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...