background preloader

jQuery Datepicker

jQuery Datepicker

CJuiDatePicker Look up a class, method, property or event CJuiDatePicker displays a datepicker. CJuiDatePicker encapsulates the JUI datepicker plugin. To use this widget, you may insert the following code in a view: $this->widget('zii.widgets.jui.CJuiDatePicker',array( 'name'=>'publishDate', // additional javascript options for the date picker plugin 'options'=>array( 'showAnim'=>'fold', ), 'htmlOptions'=>array( 'style'=>'height:20px;' ), )); By configuring the options property, you may specify the options that need to be passed to the JUI datepicker plugin. Property Details public array $defaultOptions; The default options called just one time per request. public boolean $flat; If true, shows the widget as an inline calendar and the input as a hidden field. public string $i18nScriptFile; The i18n Jquery UI script file. public string $language; the locale ID (eg 'fr', 'de') for the language to be used by the date picker. Method Details Source Code:framework/zii/widgets/jui/CJuiDatePicker.php#70 (show)

jQuery Multiple File Upload Plugin v1.47 (2010-03-26) What this is This jQuery Multiple File Upload Plugin ($.MultiFile) is a non-obstrusive plugin for jQuery that helps users easily select multiple files for upload quickly and easily on your server whilst also providing some basic validation functionality to help developers idenfity simple errors, without having to submit the form (ie.: upload files). What this isn't This plugin will not create a dialog that allows the user to select multiple files at once. That simply cannot be done via javascript. If that's what you need, you should consider using HTML5's multiple="multiple" attribute or one of the many other flash based file upload solutions (eg.: SWFupload, uploadify and others) How it works The plugin creates a new file input element every time the user select a file, which allows the user to select a file, then another, then another, then another and so on... selecting as many files is required, one at a time. How do I use it? This implementation does not require any jQuery experience.

CJuiWidget Look up a class, method, property or event This is the base class for all JUI widget classes. Public Properties Hide inherited properties Property Details public mixed $cssFile; the theme CSS file name. public array $htmlOptions; the HTML attributes that should be rendered in the HTML tag representing the JUI widget. public array $options; the initial JavaScript options that should be passed to the JUI plugin. public mixed $scriptFile; the main JUI JavaScript file. public string $scriptUrl; the root URL that contains all JUI JavaScript files. public string $theme; the JUI theme name. public string $themeUrl; the root URL that contains all JUI theme folders. Method Details Initializes the widget. Source Code:framework/zii/widgets/jui/CJuiWidget.php#108 (show) $cs->registerCoreScript('jquery'); if(is_string($this->scriptFile)) $this->registerScriptFile($this->scriptFile); elseif(is_array($this->scriptFile)) { foreach($this->scriptFile as $scriptFile) $this->registerScriptFile($scriptFile); }}

jQuery ComboGrid Plugin CJuiDatePicker in CActiveForm CJuiDatePicker/CActiveForm Yii Framework CJuiDatePicker Example For many of our web applications, we utilize the Yii Framework extensively. If you also use the Yii Framework, you might find yourself in a dilemma that we recently experienced. $this->widget('zii.widgets.jui.CJuiDatePicker', array( 'model'=>$model, 'attribute'=>'StartDate', 'value'=>$model->StartDate, // additional javascript options for the date picker plugin 'options'=>array( 'showAnim'=>'fold', 'showButtonPanel'=>true, 'autoSize'=>true, 'dateFormat'=>'yy-mm-dd', 'defaultDate'=>$model->StartDate, ), )); Do you know of other ways to accomplish this?

CBaseListView Look up a class, method, property or event CBaseListView is the base class for CListView and CGridView. CBaseListView implements the common features needed by a view wiget for rendering multiple models. Public Properties Hide inherited properties Property Details the data provider for the view. public string $emptyTagName; the HTML tag name for the container of the emptyText property. public string $emptyText; the message to be displayed when dataProvider does not have any data. public boolean $enablePagination; whether to enable pagination. public boolean $enableSorting; whether to enable sorting. See Also sortableAttributes public array $htmlOptions; the HTML options for the view container tag. public string $itemsCssClass; the CSS class name for the container of all data item display. public string $loadingCssClass; the CSS class name that will be assigned to the widget container element when the widget is updating its content via AJAX. public array|string $pager; the configuration for the pager.

CForm Look up a class, method, property or event CForm represents a form object that contains form input specifications. The main purpose of introducing the abstraction of form objects is to enhance the reusability of forms. In particular, we can divide a form in two parts: those that specify each individual form inputs, and those that decorate the form inputs. A CForm object represents the former part. It relies on the rendering process to accomplish form input decoration. A form can be rendered in different ways. Form input specifications are organized in terms of a form element hierarchy. Sub-forms are mainly used to handle multiple models. Form input specifications are given in terms of a configuration array which is used to initialize the property values of a CForm object. 'elements'=>array( 'username'=>array('type'=>'text', 'maxlength'=>80), 'password'=>array('type'=>'password', 'maxlength'=>80), ) The above code specifies two input elements: 'username' and 'password'. Property Details

Form Builder When creating HTML forms, we often find that we are writing a lot of repetitive view code which is difficult to be reused in a different project. For example, for every input field, we need to associate it with a text label and display possible validation errors. To improve the reusability of these code, we can use the form builder feature. 1. Basic Concepts ΒΆ The Yii form builder uses a CForm object to represent the specifications needed to describe an HTML form, including which data models are associated with the form, what kind of input fields there are in the form, and how to render the whole form. Form input specifications are organized in terms of a form element hierarchy. When users submit a form, the data entered into the input fields of the whole form hierarchy are submitted, including those input fields that belong to the sub-forms. 2. In the following, we show how to use the form builder to create a login form. First, we write the login action code: 3. Specifying Input Element <?

Related: