Difference between #1 and #2 of
Ordering Models by Weight with CJuiSortable

Revision #2 has been created by Matt Kelliher on Mar 11, 2010, 2:10:50 AM with the memo:

Typo...
« previous (#1) next (#3) »

Changes

Title unchanged

Ordering Models by Weight with CJuiSortable

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

Content changed

In this tutorial we will be setting up a content type to be ordered by weight using the JUI Sortable plugin. *Note: This is probably not suitable for large data sets, as each model is updated on submission.*

**Tutorial Requirements**
[...]
// Set the number of models to be the heaviest weight
// and format into a dropDownList-friendly array
$models =
BlogYourClass::model()->findAll();

for ($i = 0; $i < sizeof($models); $i++) { $weights[$i] = $i; }

echo CHtml::activeDropDownList($model, 'weight', $weights);
?>
[...]
9 0
10 followers
Viewed: 16 963 times
Version: 1.1
Category: Tutorials
Tags:
Written by: Matt Kelliher
Last updated by: Phil Loaiza
Created on: Mar 11, 2010
Last updated: 11 years ago
Update Article

Revisions

View all history