Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'cgridview'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 3 results

  1. Hello, I am using a CGridView with a CSqlDataProvider. I would like to dynamically change the text displayed in the cells for some columns. For instance: - instead of displaying a name, I would like to display a link - if a certain value is present, display this value in red I mean I want to put HTML in my cells and expect this HTML to be parsed and rendered by the browser. I don't want to change the class of the underlying <tr>, <td>... For so doing I put some expressions in the 'columns' array: 'columns' => array( 'phase', 'app', array( 'name' => 'version', 'value' => "preg_replace('/($today.+)/','<span style=\'color: red;\'>\$1</span>', \$data['version'])" ) , 'comment', 'nb', array( 'name' => 'deadline', 'value' => '"<a href=\'candidateRelease/view/id/\$data[\'id\']\'>\$data[\'deadline\']</a>)"' ) , 'status' ), Expression seems to be evaluated correctly but the text rendered in the cell shows the html tags (as if the result of the evaluation had gone through a call to htmlentities(). Does someone know how I could change this ? Thanks and regards.
  2. I have been using the Yii Book to create an admin module for a site I didn't create that uses the yii framework. I was able to successfully create the module, apply login functionality to it, and implement Yii booster for extendedgrid functionality with inline editing. I can link the text from a column using the foreign key relation to a different model's view (primary key) and display those results using the TbExtendedGridView. What doesn't seem to work for me is displaying the results according to a different attribute other than the primary key. Link: http://mysites.com/index.php?r=admin/registrations/adminlinked&id=29 http://mysites.com/index.php?r=admin/registrations/divisionLevel&id=3 RegistrationController: public function actionAdminLinked($id) { $model = $this->loadModel($id, 'Registrations'); $this->performAjaxValidation($model, 'registrations-form'); if (isset($_POST['Registrations'])) { $model->setAttributes($_POST['Registrations']); if ($model->save()) { $this->redirect(array('view', 'id' => $model->ID)); } } $this->render('adminlinked', array( 'model' => $model, )); } public function actionDivisionlevel($id) { $model=Registrations::model()->with('divisionLevel','division','level','players')->findAllByAttributes(array( 'divisionLevelID'=>$id, )); $this->performAjaxValidation($model, 'registrations-form'); $this->render('adminlinked', array( 'model' => $model, )); } Note: I'd like to add the ability to display player names (2 to 4 depending on the registration), division and level names (through divisionLevel relations). actionAdminLinked displays results correctly. actiondivisionLevel displays a blank screen. What on earth am I doing wrong that I can't seem to get this to work? I've tried for hours.
  3. Hi there, I've got a column defined in a CGridView widget, in the view file admin.php, that correctly returns the course_number attribute from a related table: <?php $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'course-taken-grid', 'dataProvider'=>$model->search(), 'columns'=>array( 'course.course_number', // Other columns array( 'class'=>'CButtonColumn', ), ), )); ?> For some reason, if I use the name/value syntax to do the same thing: array('name'=>'Course', 'value'=>'$data->course->course_number'), I get the error "Trying to get property of non-object". I can't figure out why. In the same CGridView widget, in the same file, a simliar query works: array('name'=>'Student Name', 'value'=>'$data->studentRecord->user->first_name . " " . $data->studentRecord->user->last_name'), And I need to do something similiar in order to obtain the course number and department abbreviation from related tables. Weird right? Thanks for any tips. Larry Z.
×
×
  • Create New...