EasyUI Forum
October 12, 2025, 04:28:48 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: Panel custom tool  (Read 7092 times)
jega
Full Member
***
Posts: 225


View Profile
« on: July 04, 2017, 01:49:19 AM »

Another strange problem

<div id="refPanel" class="easyui-panel" title="test" style="padding:10px;width:350px" data-options="tools:'#toolsRefPanel'">
   <span id="addRef"></span>
   <div id="toolsRefPanel">
      <a id="smsRefAdvis" href="javascript:void(0)" class="icon-add" title="Add"></a>
   </div>
</div>

The add icon shows as expected, but when mouse is over icon, it disapear. The demo works, and my code is the same, but doesn't work

Have anyone seen theis before ??
Logged
jega
Full Member
***
Posts: 225


View Profile
« Reply #1 on: July 04, 2017, 02:58:45 AM »

The error was in the link

<a id="smsRefAdvis" href="javascript:void(0)" class="icon-add" title="Add"></a>

The id was used with this code

                  $('#smsRefAdvis').linkbutton({
                     onClick: function(){
                                                           functionName(row.id);
                     }                     
                  });

Removing this code, fixes the problem.

I need to call a function with row.id param when click on the tool icon.

Trying to do this
   $('#smsRefAdvis').attr('onClick',smsAdvis(row.ID,'2','1'))
but it do not set the onClick on the element, but do a click

Any hint ??


Logged
jega
Full Member
***
Posts: 225


View Profile
« Reply #2 on: July 04, 2017, 03:22:22 AM »

Changed it to

$('#smsRefAdvis').removeAttr('onClick');
$('#smsRefAdvis').attr('onClick', "smsAdvis("+row.ID+",'2','1')");


and it works.
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!