EasyUI Forum
May 02, 2024, 07:30:03 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to change panel's iconCls?  (Read 6199 times)
James
Jr. Member
**
Posts: 52


View Profile Email
« 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
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: August 27, 2018, 11:47:04 PM »

Try this code to change the icon class on a panel.
Code:
$('#p').panel({
  iconCls: '...'
});
Logged
James
Jr. Member
**
Posts: 52


View Profile Email
« Reply #2 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;
    })
« Last Edit: August 28, 2018, 02:57:35 AM by James » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: August 28, 2018, 11:06:17 PM »

Please look at this example http://code.reloado.com/elinit3/edit#preview. It works fine.
Logged
Coder
Jr. Member
**
Posts: 96


View Profile
« Reply #4 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'});

« Last Edit: November 26, 2018, 06:35:15 PM by Coder » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #5 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'
  }
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!