EasyUI Forum
September 13, 2025, 06:45:24 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: add icon to panel dynamically  (Read 6958 times)
crosemffet
Jr. Member
**
Posts: 68



View Profile WWW Email
« on: January 20, 2016, 11:08:09 AM »

hello and thanks in advance for your support.
I have on panel, with certain icons defined.
example:

data-options:tools:'#tt'
        <div id="tt">
            <a href="javascript:void(0)" class="icon-add" onclick="javascript:alert('add')"></a>
            <a href="javascript:void(0)" class="icon-edit" onclick="javascript:alert('edit')"></a>
            <a href="javascript:void(0)" class="icon-cut" onclick="javascript:alert('cut')"></a>
        </div>

on certain events, I want to add / remove icons from the panel's header.
example, I want to add
<a href="javascript:void(0)" class="icon-help" onclick="javascript:alert('help')"></a>
how can I make it?
thanks you in advance.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: January 20, 2016, 11:20:23 PM »

Please try this:
Code:
var tool = $('#p').panel('header').find('.panel-tool');
tool.prepend('<a href="javascript:void(0)" class="icon-help"></a>');  // add an icon
tool.find('a.icon-edit').remove();  // remove an icon
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!