This widget encapsulates the Taconite jQuery plugin (Version 3.59).
The plugin is a port of Taconite to jQuery. Make multiple DOM manipulations in response to a single remote call using an XML command document.
Requirements ¶
Yii 1.1.6 or above...
Usage ¶
- extract the widget file under .../protected/extensions
- put in a view a code blocks like the following...
<h1>Example 1: Structure</h1>
<p>
This example shows how you can easily manipulate the structure of the DOM.
</p>
<input id="ex1" type="button" value="Run Example 1" />
<hr />
<div id="example1" style="background-color: #ffa; padding:10px; border:1px solid #ccc">
This is the <span style="color:#800">structure example</span> div.
</div>
<?php
$widget=$this->widget('ext.taconite.JTaconite');
$widget->addEventHandler('#ex1','click',array(
JTaconite::get("files/example1.php?ts='+new Date().getTime()); });")
));
$widget->registerScript();
?>
<br />
- the following code is used to request example1.php
<?php header('Content-type: text/xml'); ?>
<taconite>
<after select="#example1">
This text will go AFTER the example div.
</after>
<before select="#example1">
<div>This div will go BEFORE the example div.</div>
</before>
<wrap select="#example1 span">
<span style="border: 1px dashed #00F"></span>
</wrap>
<append select="#example1">
<div>This div is APPENDED</div>
</append>
</taconite>
Change log ¶
Version 1.0 ¶
- initial release
Version 1.1 ¶
- added minified javascript file
Version 1.3 ¶
- added helper methods to generate javascript code and bugfixes
Version 1.4 ¶
- little bugfix
Version 1.5 ¶
- updatet javascript
cool
i did something like this but using jsons
i'm going to try this with my xslt based application
cool and very helpful..
@ nickcv,
can you also share the json version this?
@always_smile
once i have enough time to clean it up sure
@nickcv
Thanks,
json
Why indeed! JSON is a great data exchange format. But it's not the best solution for every problem. I've found that JSON is not ideal for working with complex data structures. It can work, but it requires careful coding on both the client and server tiers. In comparison, the Taconite model only requires that the server return valid XHTML. There is no coding required on the client at all!
json
build an array -> json econde and that's it
i love xml and xslt, but i think there's not a solution that's is always the best.
there's nothing wrong about diversity :P
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.