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...
On 3/22/2019 at 12:11 AM, Sherzod said:

 Which edition are you using?

FMSoft_uniGUI_Complete_Professional_1.10.0.1466

 

FMSoft_uniGUI_Complete_runtime_1.10.0.1466

FMSoft_uniGUI_Documentation_1.10.0.1466

FMSoft_uniGUI_Theme_Pack_1.10.0.1466

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...