EasyUI Forum
April 20, 2024, 02:40:23 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: Haw can I change accordion panel icon?  (Read 4262 times)
jmansur
Newbie
*
Posts: 31


View Profile
« on: May 31, 2016, 07:02:00 AM »

Hi.

I try to change, using this sentence:

$('#acFiltros').accordion('getSelected').panel('options').IconCls = 'icon-filtro_activo_16';

or this

$('#acFiltros').accordion('getSelected').panel({iconCls: 'icon-filtro_16'});

but I cant.

Regardssss
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: June 01, 2016, 12:23:31 AM »

The extended 'setIcon' method of panel can be called to change the header icon.
Code:
<script type="text/javascript">
$.extend($.fn.panel.methods, {
setIcon: function(jq, iconCls){
return jq.each(function(){
var opts = $(this).panel('options');
var header = $(this).panel('header');
var icon = header.find('.panel-icon');
var title = header.find('.panel-title');
if (iconCls){
if (!icon.length){
icon = $('<div class="panel-icon"></div>').appendTo(header);
}
icon.removeClass(opts.iconCls).addClass(iconCls);
title.addClass('panel-with-icon');
} else {
title.removeClass('panel-with-icon');
icon.remove();
}
opts.iconCls = iconCls;
});
}
});
</script>

Please call:
Code:
$('#acFiltros').accordion('getSelected').panel('setIcon', 'icon-filtro_activo_16');
Logged
jmansur
Newbie
*
Posts: 31


View Profile
« Reply #2 on: June 01, 2016, 04:31:54 AM »

thanksssssssssss
it worked perfect

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!