<script>
 
$(function() {
 
    $( "#<?php print $this->id; ?>" ).<?php print $this->widget; ?>({<?php print $this->optionsString; ?>});
 
    <?php 
 
            if(!empty($this->methods)) {
 
                foreach ($this->methods as $method => $args) {
 
                    print     '$("#'.$this->id.'").'.$this->widget.'( "'.$method.'" , "'.$args.'");';
 
                }
 
            }            
 
            
 
            if(!empty($this->events)) {
 
                foreach ($this->events as $evnt => $hndl) {
 
                    print     '$("#'.$this->id.'" ).'.$this->widget.'({
 
                        '.$evnt.': function( event, ui ) {'.$hndl.'( event, ui );}
 
                    });';
 
                }
 
            }
 
    ?>    
 
});
 
</script>
 
 |