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)
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):
<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ü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/jeasyuiContent of ajax-request:
http://www.elba.at/flicker2/jeasyui/index.php?SystemType=ajaxpress 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