| Example Table |
|---|
| Seconds Since This Page's Last Edit: 86052082 |
dekiapi();
<table id="wholetable" class="table">
<tbody>
<tr>
<th>"Example Table";</th>
</tr>
<tr id="toptr">
<td>
web.image('http://chart.apis.google.com/chart?chs=245x145&cht=v&chd=t:' .. num.int(num.random()*100) ..',' .. num.int(num.random()*100) ..',' .. num.int(num.random()*100) ..',' .. num.int(num.random()*100) ..',' .. num.int(num.random()*100) ..',' .. num.int(num.random()*100));
</td>
</tr>
<tr id="bottomtr">
<td>
"Seconds Since This Page's Last Edit";
<br />
date.diffSeconds(page.revisions[-1].date, date.now);
</td>
</tr>
</tbody>
</table>
<input type="button" class="btn" id="reloadTop" value="Reload Top Row" ctor="when($this.click){
MindTouch.Deki.Reload(#toptr);
}"/>
<input type="button" class="btn" id="reloadBottom" value="Reload Bottom Row" ctor="when($this.click){
MindTouch.Deki.Reload(#bottomtr);
}"/>
<input type="button" class="btn" id="reloadWholeTable" value="Reload Entire Table" ctor="when($this.click){
MindTouch.Deki.Reload(#wholetable);
}"/>
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by
I've had two problems reloading page elements in the past, which both relate to elements that have dynamic behaviors. (1) elements that use unique ids (@id), which I use a lot of necessity, don't work, because they reload with new @id, and (2) event linkages break. If I have a CTOR element inside the reloaded element, the JavaScript code doesn't come with it upon reload. If I have other events helper bound to the element via jQuery, those all break and must be re-bound afterwords. Are there any best practices how to handle reload of dynamic elements in the wiki environment?