This is my first extension so I made something simple. A spinner form element similar to Java JSpinner
| type | string | A read only attribute. It's automatically decided depending on the kind of the spinner. The types can be numeric, string or time. | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| model | CActiveRecord | A active record model of the attribute associated with the spinner . | ||||||||||||||||||
| attribute | string | The attribute of the active record model. | ||||||||||||||||||
| name | string | The name of the form model attribute. | ||||||||||||||||||
| width | integer | The width of the spinner's input field in pixels (default 30). | ||||||||||||||||||
| height | integer | The height of the spinner (default 22). | ||||||||||||||||||
| bgColor | string | The background color of the spinner's buttons (default white). | ||||||||||||||||||
| text | string | A text printed next to the spinner. | ||||||||||||||||||
| delay | integer | The delay of the spinner's values update in ms when the mouse is kept pressed on up/down button (Default is 100).Small delays means faster spinner speed | ||||||||||||||||||
| acceleration | string | Spinner's speed acceleration when the mouse is kept pressed on up/down button.Valid values are none, slow, normal, fast. Default is none | ||||||||||||||||||
| htmlOptions | array | The textbox htmlOptions.You can set the textbox as editable by setting "readonly"=>false | ||||||||||||||||||
| data | array | An array with the spinners data.Data elements depend on the spinner's
type. These elements can be: All Spinners:
|
<div> <p> <b>SNumericSpinner:</b> <?php $this->widget('application.extensions.spinner.SNumericSpinner', array( "name"=>"stockInt", "data"=>array( "min"=>0, "max"=>100, "value"=>10 ), "width"=>40, "text"=>"A numeric (integer) spinner", "delay"=>150, "acceleration"=>"slow" ) ); <br /> <?php $this->widget('application.extensions.spinner.SNumericSpinner', array( "name"=>"stockFloat", "data"=>array( "min"=>0, "max"=>100, "step"=>0.5, "value"=>5.50 ), "width"=>60, "precision"=>2, "text"=>"A numeric (float) spinner", "delay"=>100, "acceleration"=>"fast" ) ); </p> <p> <b>STextSpinner:</b> <?php $this->widget('application.extensions.spinner.STextSpinner', array( "name"=>"category", "data"=>array( "list"=> array("Category A","Category B","Category C"), "value"=> 0, ), "width"=>100, "text"=>"A string spinner", ) ); </p> <p> <b>A Time Spinner:</b> <?php $this->widget('application.extensions.spinner.STimeSpinner', array( "name"=>"time", "data"=>array( "min"=>"00:00", "max"=>"23:59", "step"=>15, "value"=>"12:00" ), "width"=>60, "text"=>"A Time spinner (15 minutes step)", "delay"=>100, "acceleration"=>"slow" ) ); </p> </div>
Total 1 comment
The demo page is error unfortunately...
Leave a comment
Please login to leave your comment.