EasyUI Forum
September 14, 2025, 04:55:39 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: no easyui-linkbutton?  (Read 19835 times)
digo
Newbie
*
Posts: 26


View Profile
« on: June 27, 2012, 06:23:36 AM »

Hi!

I am using easyui-layout, content within div-region north comes from an ajax-request (e.g. ajax_north.php).

ajax_north.php just sends:

Code:
<a href="#" id="ajaxLinkButtonID" class="easyui-linkbutton" iconCls="icon-adduser" plain="true" onclick="newUser()">Add new User</a>

The problem: I just see a normal link - not a easyui-linkbutton.

How can I create a "dynamic" easyui-linkbutton?

Thanks!
Ciao
Digo
Logged
digo
Newbie
*
Posts: 26


View Profile
« Reply #1 on: June 28, 2012, 12:42:49 AM »

found a solution:

$.parser.parse();

Ciao
Digo
Logged
digo
Newbie
*
Posts: 26


View Profile
« Reply #2 on: June 28, 2012, 04:29:06 AM »

ok, $.parser.parse(); seemed to be my solution, but...

I will have to go into more details:

We have a div (id=TicketContent) and an ajax-request (the content end in TicketContent-div)

Code:
   var ActID=11;
   $.ajax({
      type: "POST",
      url: "index.php",
      data: { SystemType: "CRT", ID: ActID }
   }).done(function( returnHTML ) {
      $("#TicketContent").html(returnHTML);
      $.parser.parse();
   });

returnHTML contains easyui-linkbutton, easyui-dialog (including a form and easyui-linkbutton):

Code:
<h1>I AM AJAX-CONTENT</h1>
<a href="#" id="AddButtonIDAJAX" class="easyui-linkbutton" iconCls="icon-adduser" plain="true" onclick="newUserAjax()">AJAX-Button Dialog</a>

<div id="dlg-ajax" class="easyui-dialog" style="width:400px;height:320px;padding:10px 20px" closed="true" buttons="#dlg-buttons1">
<div class="ftitle">AJAX-Dialog</div>
<form id="fm-ajax" method="post" novalidate>
<div class="fitem">
<label>Username:</label>
<input name="username" class="easyui-validatebox" required="true" missingMessage="Pflichtfeld">
</div>
<div class="fitem">
<label>Vorname:</label>
<input name="firstname" class="easyui-validatebox" required="true" missingMessage="Pflichtfeld">
</div>
<div class="fitem">
<label>Familienname:</label>
<input name="lastname" class="easyui-validatebox" required="true" missingMessage="Pflichtfeld">
</div>
<div class="fitem">
<label>Verf&uuml;ger:</label>
<input name="verfueger" class="easyui-validatebox" required="true" validType="EFORCE_OR_VERF[16]" invalidMessage="16 Stellen, Beispiel: ELOOE01V1V000001" missingMessage="16 Stellen, Beispiel: ELOOE01V1V000001">
</div>
<div class="fitem">
<label>Firma:</label>
<input name="company" class="easyui-validatebox" required="true" missingMessage="Pflichtfeld">
</div>
</form>
</div>

   <div id="dlg-buttons1">
<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveUserAdd()">Speichern</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg-ajax').dialog('close')">Abbrechen</a>
</div>

I added $.parser.parse(); right after the first ajax-call -everything is fine.
I see the divs created by the parser (panel window, ...) at the end of html-source (Firebug)

The problem: after the second ajax-call I see all the divs generated a second-time, after
the third call you will find 3 divs with the exact same content, including same ids.

Working example:
http://www.elba.at/flicker2/jeasyui

Content of ajax-request:
http://www.elba.at/flicker2/jeasyui/index.php?SystemType=ajax

press Button ajax-call
press AJAX-Button Dialog

--> no problem, works fine

press Button ajax-call again
press Button ajax-call again
...
...
press Button ajax-call again
press AJAX-Button Dialog --> buttons are gone

and now use Firebug to see the generated html-source-code.


Any suggestions?


Ciao
Digo
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: June 28, 2012, 05:24:52 AM »

Define a panel and use the href property to load and auto parse components. Donnot need to call parse() method.
<div id="TicketContent" class="easyui-panel"/>

To reload the content, call 'refresh' method of panel.
$('#TicketContent').panel('refresh','index.php?ID=...‘);
Logged
digo
Newbie
*
Posts: 26


View Profile
« Reply #4 on: July 02, 2012, 06:31:54 AM »

Hi!

Thanks for your quick reply.

I defined a panel and I am using
$('#TicketContent').panel('refresh','index.php?ID=...‘);
to load data.

Strange thing: it seems to work now, but when you use Firebug you can see, that
additional (ident.) code is still being added.

example:
http://www.elba.at/flicker2/jeasyui/

Thanks!
Ciao
Digo

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!