This extension is a widget to create Vista-like form buttons.
Currently, it supports these button types:
protected/extensionsYii::import('application.extensions.button.DDButton');
Use the widget in a form view.
echo CHtml::beginForm( array( $update?'update':'create', 'id'=>$model->id ), 'POST', array( 'id'=>'PostForm' ) );
$this->widget( 'application.extensions.button.DDButton', array( 'title'=>$update ? 'Save':'Create', 'linkTitle'=>$update ? 'Save this record' : 'Create this record', 'formID' => 'PostForm', 'buttonType' => 'save' ));
$this->widget( 'application.extensions.button.DDButton', array( 'title'=>'Reset', 'linkTitle'=>'Reset the form data', 'formID' => 'PostForm', 'buttonType' => 'reset', 'confirm' => 'Really reset this form?' ));
$this->widget( 'application.extensions.button.DDButton', array( 'title'=>'Cancel', 'linkTitle'=>'Cancel editing, back to list', 'formID' => 'PostForm', 'buttonType' => 'cancel', 'url' => array('post/admin') ));
Total 4 comments
Simply include the jQuery lib using the
How to configure the button that open java script?...
Hi! Nice work.
I have a problem with submit: if the form hasn't some other jquery calls, jQuery is undefined, so submit button doesn't work. I have changed to use getElementById, like reset button:
Excellet work.
Leave a comment
Please login to leave your comment.