Hello. I want to modify {summary} in template of CGridView. Default summary display info looks like: {start} - {end} from {count}. For example i have records in my db, which are assigned to many users. I want to display "summary" like that: {count all records assigned only to actual logged user} - {count all observations in database}. Can anyone help me with this?
<?php
widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_viewEvents',
'summaryText'=> '{count all observations in database}', // to remove the
'template'=>'{sorter}{pager}{summary}{items}{pager}{summary}{sorter}', // this code display pager, item, sorter etc
//'template'=>'{items}', // to remove pager from the page use this code and remove above line
'pager'=>array(
'header'=>'',//text before it
//page'=>'',
'firstPageLabel'=>'',//overwrite firstPage lable
'lastPageLabel'=>'',//overwrite lastPage lable
'nextPageLabel'=>'',//overwrite nextPage lable
'prevPageLabel'=>'',//overwrite prePage lable
),
)); ?>
Thanks for help, but I think that You didn’t understand me, so i try to explain again what I was thinking about:
I want to modify {summary} in template of CGridView. Default summary display info which looks like: {start} - {end} from {count}. For example i have posts in my db, which are assigned to their authors by authors_id in Post model.
My post model:
Posts(id,title,content,authors_id, category_id)
I want to display lists of posts (in CGridVIew) of currently logged user with summary in CGridVIew header like: (count all posts of currently logged user)/(count all posts of all users in db). Additional, posts are assigned to categories(like: Cars, Home, Music, Books etc.) and if currently logged user is filtering (or search) his own posts by category (for example by Category Cars), then i want to display summary in CGridView like that: (count all posts of currently logged user from "Cars" category)/(count all posts of all users in db from "Cars" category"). I hope you understand me now:)
P.s. I don’t need to use CGridView {summary} field - i can use my own function to display that if this will be easier to do that.
Tsunami, i know this, but my problem is that additionaly, posts are assigned to categories(like: Cars, Home, Music, Books etc.) and if currently logged user is filtering (or search) his own posts by category (for example by Category Cars), then i want to display summary in CGridView like that: (count all posts of currently logged user from “Cars” category)/(count all posts of all users in db from “Cars” category"). I hope you understand me now:) Thanks for reply
$(document).ready(function(){
$('#Wines_username_auto').change(function() {
var val = $("#Wines_username").val($('#Wines_username_auto').val());
updateGridAuto(val);
});
});