EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: James on August 27, 2018, 02:52:09 AM



Title: how to change panel's iconCls?
Post by: James on August 27, 2018, 02:52:09 AM
how to change panel's iconCls?


PS: another https://www.jeasyui.com/forum/index.php?topic=7518.0


Title: Re: how to change panel's iconCls?
Post by: jarry on August 27, 2018, 11:47:04 PM
Try this code to change the icon class on a panel.
Code:
$('#p').panel({
  iconCls: '...'
});


Title: Re: how to change panel's iconCls?
Post by: James on August 28, 2018, 02:55:03 AM
Try this code to change the icon class on a panel.
Code:
$('#p').panel({
  iconCls: '...'
});

I have tried this,  I have many "<a>" links click to refresh panel, it only work once, if you do it again : Uncaught TypeError: Cannot read property 'panel' of undefined

Code:
    $('.esys-sysmenu').find('a').click(function (e) {
        e.preventDefault();
//        $('#esys-item').panel({
//            title:$(this).text(),
//            iconCls:$(this).linkbutton('options').iconCls
//        });
// if use code up then Uncaught TypeError: Cannot read property 'panel' of undefined
        $('#esys-item').panel('refresh', this.href);
        $('#esys-item').panel('setTitle',$(this).text());
        //$('#esys-item').panel('options').iconCls = $(this).linkbutton('options').iconCls;  //this not work
        return false;
    })


Title: Re: how to change panel's iconCls?
Post by: jarry on August 28, 2018, 11:06:17 PM
Please look at this example http://code.reloado.com/elinit3/edit#preview. It works fine.


Title: [FIXED] didnt work :(
Post by: Coder on November 23, 2018, 07:12:08 PM
Code:
var tabPanel;
var p = $('#tabsF').tabs('tabs');
if (p){
 $.each(p,function(eachIndex,tabItem){
  if(tabItem[0].id == hID){
   // tabPanel = tabItem;  // <-- with this didnt work too
   var index = $('#tabsF').tabs('getTabIndex', tabItem);
   tabPanel = $('#tabsF').tabs('getTab', index);
   return false;//leave each
  }
 });
}

tabPanel.panel({iconCls:'icon-ok'});



Title: Re: how to change panel's iconCls?
Post by: jarry on November 23, 2018, 07:36:17 PM
Please call the 'update' method to update a tab panel's header.
Code:
$('#tabsF').tabs('update',{
  tab: tabPanel,
  type:'header',
  options:{
    iconCls: 'icon-ok'
  }
})