need help with CListView

As you can see in the image below I am using CListView to list some items from database table. What is bothering me is this part:




<div title="/victors/index.php?r=cars/view&amp;id=1" style="display:none" class="keys">

<span>1</span>

<span>2</span>

</div>



The numbers that you see in enclosed in span are id numbers for those items and they are generated and inserted by ClistView and I can’t find where to turn it off.

I need to remove the whole thing, do you know where do I turn off this whole autogenerated div off?

Any help is really appreciated.

hehehe… :lol:

i don’t think this trouble you , because the div is invisible, this will be helpful for the ajax functionality . both listView and GridView ajax functionality will use it .

if you want close it ,the only thing is to extend your owner ListView and overwrite the function : renderKeys() , please refer to code of CBaseListView

but the drawback is that your ajax function will be to break down. remember that yii doesn’t give you useless code :angry:

Another remedy is you use the $captureOutput third parameter of $this->widge.

if it’s true you will get to capture the output generated by the widget, and you can convert the output to things suited yourself.

oh i’d forgotten to refer to the class reference.

check this CBaseController::widget() for details.

thanks guys, I decided to extend CBaseListView and CListView to be able to control this, it was the most simple solution althought I would have prefered that Yii allowed me to turn this off/on. It may be good for ajax stuff as yiqing95 pointed but if I am not interested in ajax and use some other jquery plugins that do not work just because of that stuff I want to remove.

For example take a look at this:

That is using this plugin:

http://caroufredsel.frebsite.nl/examples/intermediate-carousels.php

A great jquery plugin that allows you to have any kind of carousel using javascript.

The page above is where I actually had problem. When listing carpics for specific car and using CListView I would get these and jquery plugin would not work.

I spent 6 hours pulling my hairs out because it was all working for me in plain html but not with yii. I debuged it for hours, I know I’m slow and found out if was those lines of code to make it stop working.

So thats why I had no option if I wanted to use this great jquery plugin which I recomend to all you doing webdevelopment, customers will love it! :) Just remember you will need to remove those ajax things :)

If any Yii developer is reading this, please make it possible to turn it off so we dont have to extend base classed in order to do it! :)




<div title="/victors/index.php?r=cars/view&amp;id=1" style="display:none" class="keys">

<span>1</span>

<span>2</span>

</div>