Showing 121-140 of 268 items.

Simple way to use AutoComplete using different ID and Display Value

Created 14 years ago by raheelk2k raheelk2k, updated 14 years ago by raheelk2k raheelk2k. 5 comments

Usually when we use AutoComplete in a project, We need to show "title" or "name" in the list, while when the form is posted, we need some sort of integer ID referring to the selected value. Out of the Box, CJuiAutoComplete widget doesn't provides different display text and post values.

6 0
13
Viewed: 67 608 times
Version: 1.1
Category: Tutorials

Custom Number Formatting or Decimal Separators and i18n

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba c@cba. 8 comments

By default, the decimal separator in php (also in mysql) is a dot (.). So when we work with floats in Yii (in calculations, validation, sql statements etc.), the decimal separator has to be a dot. If we want to use for example a comma (,) as the decimal separator, that is if we want to display numbers and enable users to enter numbers with a comma before the decimals, we have to...

4 0
16
Viewed: 95 127 times
Version: 1.1
Category: Tutorials

Dynamic parent and child CGridView on single view. Using $.ajax to update child gridview via controller, after row in parent gridview was clicked.

Created 14 years ago by Gerhard Liebenberg Gerhard Liebenberg, updated 12 years ago by Gerhard Liebenberg Gerhard Liebenberg. 20 comments

Many desktop programmers are used to having dynamic forms, where clicking on a record in a parent sub-form, updates another sub-form with the child records. While having many levels of nested sub-forms in a single view might not be such a good idea for a web application, I thought doing it one level deep might be interesting and useful. But, instead of sub-forms I used CGridViews.

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba c@cba. 3 comments

    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this:
'value'=>'$data->author->username',.
    Now we might want to use $data in the declaration of the `...

19 1
14
Viewed: 85 183 times
Version: 1.1
Category: Tutorials