Hi, I’ve found this in CBaseListView:
$this->htmlOptions['id']=$this->getId();
which I think it’s a bug, because if I need to set a specific ID for a CGridView or CListView, I can’t. So I made this patch:
Index: lib/yii-1.1.8.r3324/framework/zii/widgets/CBaseListView.php
===================================================================
--- yii-1.1.8.r3324/framework/zii/widgets/CBaseListView.php (revisión: 326)
+++ yii-1.1.8.r3324/framework/zii/widgets/CBaseListView.php (copia de trabajo)
@@ -104,7 +104,7 @@
$this->dataProvider->getData();
- $this->htmlOptions['id']=$this->getId();
+ if (!isset($this->htmlOptions['id'])) $this->htmlOptions['id']=$this->getId();
if($this->enableSorting && $this->dataProvider->getSort()===false)
$this->enableSorting=false;
I hope this patch doesn’t break other things.