Hi, first thanks for this extension but i noticed that it doesn’t work when the urlManager urlFormat property set to “path”
Hi, first thanks for this extension but i noticed that it doesn’t work when the urlManager urlFormat property set to “path”
Hello.
Glad it helped. However, I only ever use the path urlFormat and don’t have any problems.
I think your problem must come from something else.
Feel free to post some error messages and code about it.
hi, thank you for the excellent extension.
i just want to notify you that there is a conflict with facebook comments plugin.
i created an image gallery for a client and used your extension to navigate images with ajax.
if there are comments in the same page as the extension, facebook will add some GET param and invoke a js call which will add a hash to the url removing your hash, and the extension will navigate to the first page when the hash is changed to facebook’s hash.
trying to navigate to other pages using the extension will not work, because facebook takes control over the hash and changes it back.
an example you can see:
the page working fine:
sahar-rouhana.com/albums/images/158?ajax=enable&fb=10321&imp=5#Images_page=5
the link from facebook will generate the problem:
any ideas will be appreciated.
Thanks.
I’ll try and have a look at it when I get the time (I’m quite busy at the moment).
I haven’t used the Facebook plugin, but as far as I remember, my extension should play nicely with anything else that uses the hash (as long as the parameter names don’t conflict) - I don’t think I ever replace or remove the hash, and when a hash change is detected it will only trigger an ajax action if it involves one of the registered parameters, so without having looked into it, I would guess that it is the Facebook plugin which is overriding the hash, in which case that is what would need to be corrected.
The other scenario is that the Facebook plugin uses CListView or CGridView in which case there might be a problem because my extension overrides the Javascript for those widgets, in which case I would perhaps have to see about completely separating it from them.
Hi, I don’t know what I do wrong, but as I use RRViews, the Filter-Methods don’t work anymore…
Here is my code:
<?php
$this->widget('ext.RRViews.RRGridView', array(
'id'=>'customer-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
//'ajaxUpdate'=>true,
//'ajaxUrl'=>CHtml::normalizeUrl(Yii::app()->createUrl('/customer/customeradminplain')),
'cssFile' => Yii::app()->baseUrl . '/css/gridview/styles.css',
//'afterAjaxUpdate' => 'function(id,data){ alert(id) }',
//'selectionChanged'=>'jumpToUpdate',
'selectableRows'=>2,
'columns'=>array(
array(
'class'=>'CCheckBoxColumn',
'value'=>'$data->customer_id',
'id'=>'customer_id',
),
array(
'class'=>'CButtonColumn',
'template'=>'{update}',
'header'=>'edit',
'updateButtonUrl'=>'Yii::app()->createUrl("/customer/update", array("id" => $data->customer_id))',
),
array(
'name'=>'cus_name',
'type'=>'raw',
'value' => '$data->cus_name .", ". $data->cus_prename',
// 'htmlOptions'=>array(
// 'style'=>'width:230px',
// ),
),
/*array(
'name'=>'status',
'value'=>'CHtml::encode($data->status)',
'filter'=> SWHelper::allStatuslistData($model),
),*/
//'customer_id',
//'parent_customer_id',
//'cus_number',
// array(
// 'name'=>'cus_prename',
// 'htmlOptions'=>array(
// 'style'=>'width:230px',
// ),
// ),
array (
'name' => 'addresses_add_street',
'type' => 'raw',
'value' => 'CHtml::Link($data->addresses[0]->add_street.CHtml::image(Yii::app()->request->baseUrl."/images/edit.png"),
"",
array(
"onClick" => CHtml::ajax(
array(
"type" => "POST",
"url" => "js:$(this).attr(\'href\')",
"update" => "#divForForm",
"success"=>"js:function(){
addAddress._updateAddress_url = \'".Yii::app()->createUrl("/address/update",array("id"=>$data->addresses[0]->address_id))."\';
addAddress();
$(\"#dialogAddress\").dialog(\"open\");
}",
)
),
"style"=>"text-decoration:none; cursor:pointer",
)
)',
'htmlOptions'=>array(
'style'=>'width:170px',
),
),
array (
'name' => 'addresses_add_town',
'value' => '$data->addresses[0]->add_town',
'htmlOptions'=>array(
'style'=>'width:100px',
),
),
array (
'name' => 'communications.com_value',
'type' => 'raw',
'value' => 'CHtml::Link($data->communications[0]->com_value.CHtml::image(Yii::app()->request->baseUrl."/images/edit.png"),
"",
array(
"onClick" => CHtml::ajax(
array(
"type" => "POST",
"url" => "js:$(this).attr(\'href\')",
"update" => "#divForForm",
"success"=>"js:function(){
addCommunication._updateCommunication_url = \'".Yii::app()->createUrl("/communication/update",array("id"=>$data->communications[0]->communication_id))."\';
addCommunication();
$(\"#dialogCommunication\").dialog(\"open\");
}",
)
),
"style"=>"text-decoration:none; cursor:pointer",
)
)',
/*'htmlOptions'=>array(
'style'=>'width:100px',
),*/
),
'cus_newsletter',
array(
'class'=>'EButtonColumnWithClearFilters',
'template'=>'{delete}',
'deleteButtonUrl'=>'Yii::app()->createUrl("/customer/delete", array("id" => $data->customer_id))',
),
)
));
$this->endWidget();
?>
And I use this code inside the model:
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->with=array('addresses'=>array('together'=>true),'communications'=>array('scopes'=>'mainphone'));
$criteria->compare('customer_id',$this->customer_id);
$criteria->compare('parent_customer_id',$this->parent_customer_id);
$criteria->compare('vdsite_id',$this->vdsite_id);
$criteria->compare('paymenttype_id',$this->paymenttype_id);
$criteria->compare('user_id',$this->user_id);
$criteria->compare('cus_number',$this->cus_number,true);
$criteria->compare('LOWER(cus_name)',strtolower($this->cus_name),true);
$criteria->compare('LOWER(cus_prename)',strtolower($this->cus_prename),true);
$criteria->compare('cus_birthdate',$this->cus_birthdate,true);
$criteria->compare('cus_gender',$this->cus_gender);
$criteria->compare('cus_creationdate',$this->cus_creationdate,true);
$criteria->compare('cus_deleted',0);
$criteria->compare('status',$this->status,true);
$criteria->compare('cus_uid',$this->cus_uid,true);
$criteria->compare('cus_company_type',$this->cus_company_type);
$criteria->compare('cus_company_number',$this->cus_company_number,true);
$criteria->compare('cus_securitycheck',$this->cus_securitycheck);
$criteria->compare('cus_barcode',$this->cus_barcode,true);
$criteria->compare('cus_invoice',$this->cus_invoice,true);
$criteria->compare('cus_newsletter',$this->cus_newsletter,true);
$criteria->compare('addresses.add_town',$this->addresses_add_town,true);
$criteria->compare('addresses.add_street',$this->addresses_add_street,true);
return new CActiveDataProvider(get_class($this), array(
'criteria'=>$criteria,
'sort'=>array(
'defaultOrder'=>'cus_name ASC',
),
'pagination'=>array(
'pageSize'=>50,
),
));
}
And don’t forget the controller:
public function actionCustomerAdmin()
{
$model=new Customer('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Customer']))
$model->attributes=$_GET['Customer'];
$this->render('_customer_admin',array(
'model'=>$model,
));
}
Thank you for your help! Cheers Phil
I’m using the latest yii - version from google svn…
Hi,
I have a serious problem with rrviews, after upgrading to yii 1.9 ->looks like some of the js api has changed, so some of your code isn’t working any more:(
I’m sorry to say, but my js-skills aren’t good enough to fix it…
Regards Philipp
You need to delete all in your assets directory whenever you upgrade. ![]()
Try that first
Did that before… Doesn’t help… I have a ListView on the same page… could that be an issue…?
Only one way to find out: comment it out. ![]()
But it sounds likely.
ok, it’s in line 157:
$.fn.yiiGridView.selectCheckedRows(id);
and if i make a comment arround, after i try to make a paging, then the complete js, code fails…
Are you passing an id in htmlOptions for the widgets?
yes, id is passed:
$this->widget('ext.RRViews.RRGridView', array(
'id'=>'customer-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'extensionAssets' => Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('ext.RRViews.assets')),
'cssFile' => Yii::app()->baseUrl . '/css/gridview/styles.css',
'ajaxUrl'=>CHtml::normalizeUrl(Yii::app()->createUrl('/customer/customeradminplain')),
//'selectionChanged'=>'jumpToUpdate',
'selectableRows'=>2,
'columns'=>array(
I meant in a ‘htmlOptions’ array within the options array.
I could be wrong, of course.
Check that the id is set properly (view source) - otherwise the first widget, or is it the second? would fail due to same id.
Hi, I added the id to html-options… now i still have a problem…
2416
I first had an improvement while i was adding a Column customer_id at first column (in sample its id) which removes the first error, but as shown in the pic, paging doesn’t work anymore…
Thank you so much for your support!
The problem is that in revision 3486 selectCheckedRows() was made private and rrviews is using this function.
Take a look at svn/tags/1.1.9/framework/zii/widgets/assets/gridview/jquery.yiigridview.js on code.google.com
While extension developers are working on the update, here’s the workaround that worked for me: just revert Yii’s jquery.yiigridview.js (located in Yii framework dir in zii/widgets/assets/gridview/) to revision 3437 (yii.googlecode.com/svn-history/r3437/trunk/framework/zii/widgets/assets/gridview/jquery.yiigridview.js).
Do not forget to empty your application’s assets folder after that.
THANK YOU!!! This workaround is working! Hope that rrviews or yii-developers will come with a path soon, as I’m not very good in managing to many different versions of the perfect components everybody builds here!
It’s true – RRGridView and friends are broken with Yii 1.1.9 or higher. The JS for yiiGridView has changed significantly.
Has this issue been fixed?
Sorry for not having replied before - I haven’t looked at this thread for some time, and for some reason I haven’t had any notification emails about people adding comments.
This issue has not been fixed yet. I have a version that I have modified which is running ok, but I’m not satisfied enough to release that yet, and haven’t had the time to work properly on it. As Preston pointed out, there has been pretty much a complete rewrite of the Javascript for CListView and CGridView, so everything I did to try and ensure forward compatibility has been to no avail. That said, I think the rewrite is a significant improvement, but because it uses anonymous functions, I haven’t found a way that is to my liking to override the framework Javascript without impacting functionality for the standard grid and list views. It may be that I just have to accept that I can’t extend the Yii Javascript and just replace it with my own.
Anyway, sorry for the delay (I hadn’t seen that people were asking for it), and I will upload something that works soon (even though it may not be very forward compatible).
Actually, just having snooped around on GitHub a bit, I see that support has been added to CListView and CGridView for Html5 history - is there any point in my updating my extension given this?