Yii 1.1: jtaconite

Make multiple DOM manipulations in response to a single remote call using an XML command document.
7 followers

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

Resources

Total 6 comments

#3331 report it
nickcv at 2011/04/03 08:02pm
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

#3326 report it
volkmar at 2011/04/03 12:05pm
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!

#3297 report it
Always Smile at 2011/04/01 01:30am
@nickcv

Thanks,

#3291 report it
nickcv at 2011/03/31 03:08pm
@always_smile

once i have enough time to clean it up sure

#3290 report it
Always Smile at 2011/03/31 02:25pm
cool and very helpful..

@ nickcv, can you also share the json version this?

#3274 report it
nickcv at 2011/03/30 07:49pm
cool

i did something like this but using jsons
i'm going to try this with my xslt based application

Leave a comment

Please to leave your comment.

Create extension