Unfortunately there is no option to define how to open a submenu (click vs hover) no matter what level. Not sure if you can achieve this by just adding css classes through "itemOptions" and "linkOptions"?

A small solution is to set collapse to true. This will change toolbar (along with menus and submenus) to a very nice, clickable thing on small screens.

But this will fail on large ones, like iPad, where there is enough space to draw whole toolbar but where there is no hover gesture.

Compliling .less files is not a problem for me. The real problem is to be able to change .less files extension uses, to change the layout, without changing extension source files or code.

I've never used Bootswatch so I don't know how the download file looks like.
I assume it's another bootstrap.css.

You can set coreCss=false in config/main.php and load/register the new bootstrap in the layout files (before any additional css files). This way you won't touch the original. Put the new bootstrap wherever you want. /css or in the extension folder. Depending on location you have to register or publish/register.

add-on:
unfortunately there is no way to set coreCss=false and set an alternative url right there in the bootstrap's config. at least not that i know of. maybe that would be another nice feature for future updates?

I've never used Bootswatch so I don't know how the download file looks like. I assume it's another bootstrap.css.

Chris has responded to my comment and assured me that using Bootswatch shouldn't be any problem. I'm going to test this these days or next week and I'll write down here (or craft a small wiki article), if I find something interesting.

That said, let me tell you what brought me here.
Iam a yii newbie (started a week ago) and i want to use the Thumbnail grid in order to display some countries images, and then i want to drill in each country and display the cities, etc, without reloading the entire screen, just the right side.

Code for the create view

<?php
echo $this->renderPartial('_form', $this);
?>

Between other things this view below is used to display the images. It has two divs. One for picking the images that relates to the countries/cities, the other displays the choice that the user made in terms of city by clicking in a button that is supposed to be near the picture, but only when the user drills into the cities.1st doubt -> should i be rendering partials? I only want to refresh the right side of the screen, the one that has the images. Take into account that iam rendering one partial in the previous code, and other below. Is that even possible?

i am working with the TbGridView component, i am loading it with a dataprovider, in this dataprovider i am adding a criteria to bring relational data, everything is working ok for now, but the component is showing me the new header column without the link to order data, i need the same options to order the gridview.

i am working with the TbGridView component, i am loading it with a dataprovider, in this dataprovider i am adding a criteria to bring relational data, everything is working ok for now, but the component is showing me the new header column without the link to order data, i need the same options to order the gridview.

Any suggestion? maybe an example.

Thanks for your help.

Hi Salas,

TbGridView extends CGridView hence your question is not related to this extension. However, you will find your answer here. Read it once and make sure to follow it step by step!

1stly would like to thanks for an awesome extension.
I just tested my app on iPad today, the dropdown (TbMenu) does not work.
When i click on the sub menu it just close, no action trigger. I look like on iPad browser it does not recognize click.
I also test on your demo web site, it does not work as well.

Yes. Your post is quite long, so sorry, if my answer isn't that much detailed. I'll try to help you as much as I can.

First of all. If my answer doesn't help you too much, try to separate your post into parts that concers Yii itself (most things about renderPartial, which is core framework function) and these parts that concerns Yii-Bootstrap extension. Ask first question into general Yii Framework Discussion forum.

luismcax, on 23 October 2012 - 07:20 AM, said:

1st doubt -> should i be rendering partials? I only want to refresh the right side of the screen, the one that has the images. Take into account that iam rendering one partial in the previous code, and other below. Is that even possible?

I think you misunderstood, how renderPartial works and for what purpose it should be used.

First. It actually renders a partial view as a part of rendering whole page. It's mainly use to separate large view into smaller, maybe more readable files. Or to extract parts used in many views into the separate sub-view. So, you can use as much partialRenders as you want. But, to be honest I have never seen a working example, where you use only renderPartials, directly in controller, without using one general render function. I always use it that way, that no matter, if I'm updating whole page or just a part of it, I always use render in my controller and renderPartials are only used inside view files (or layouts or themes) to render subviews, parts of them etc.

Get into class reference and watch for the source code for CController.renderPartial and other similar functions and try to catch the differences. There are slightly in most cases.

Second. Don't forget that you have to make an AJAX call and add extra JavaScript code in your view to actually put parts of your page that has changed into relevant part of your page. renderPartial itself won't do that for you. This is a purely server-side (PHP) function and it won't do nothing on client side for you.

This is the kind of question, you should ask on general forum, not here, if you still have problems with that. Write there a question, if someone can give you some example of using renderPartial and AJAX call for updating just a part of your page. You should get immediate response. Write me a PM with a link to such question, then I'll try to diggout mine own old example and put you there. I'm forcing you to create a new question, because this is not related to this extension and because I hope other, that don't use Yii-Bootstrap at all, will benefit from answers put to such question asked in general thread.

luismcax, on 23 October 2012 - 07:20 AM, said:

2nd doubt -> How can i drill down clicking the image, instead of having a button to do that???

If you would won't to do that with a simple image ("img" tag), then the answer would be quite simple. You have to use htmlOptions of such image (when rendering it into page, with for example CHtml::tag or many others) and add there click element that you would point into JavaScript function that will make an AJAX call, get the results and put them into part of your page, where you want them to be put. This is one of way of solving it. There are few others. Try to search the forum, question like that was a lot.

But, since you want to use it on Yii-Bootstrap thumbnail widget, then the answer isn't that simple. I must admit, that I don't have much experience with this and that someone who used this widget a bit more, will have to help you.

luismcax, on 23 October 2012 - 07:20 AM, said:

3rd doubt -> how many renderPartials can be nested?

See above. As much as you want.

luismcax, on 23 October 2012 - 07:20 AM, said:

The action above fires up this view _formCity which in turn calls _cityThumb

You didn't provide code for _viewCity action, so I don't know, if it really calls _viewThumb. But, first of all, don't mess actions with views. Action can render a view, but names aren't the same. If you have action named _viewThumb for example, it won't automatically render you the same view until you order it to do this. Beside, actions are fired in controllers, not in view. View itself can't fire any action. It can only do a redirect, which, as an effect will change the URL and call different controller, which will then call another action. This breaks MVC design pattern (redirects should be done in controllers, not in views), but generally works.

Second. Code example above, shows that TbThumbnails should render (use) _cityThumbview. And, this will not fire any action! It will only render a view, which name you provided in itemView parameter. So, if you're expecting that any action will be fired this way, it won't.

luismcax, on 23 October 2012 - 07:20 AM, said:

4th doubt -> The cities were the only screen that was rendered, when i clicked the button to show me the cities, nothing happened, why

See all above answers. You have to provide extra JavaScript code (many ways to achieve it) in your view, that will fire an AJAX call (which will call proper controller and action), handle results received and put them into part, you want to update. renderPartial won't do this for you itself. Plus -- clear the idea, you look and think about it. Don't mess views with actions. These are not the same.

I just tested my app on iPad today, the dropdown (TbMenu) does not work.
When i click on the sub menu it just close, no action trigger. I look like on iPad browser it does not recognize click.
I also test on your demo web site, it does not work as well.

This question was already asked by me in this forum (look here). So try to use a search before reposting the same question. Simple "bootstrap submenu" search should reveal you, that this question was already asked.

As I found myself, this is not Yii-Bootstrap (Chris extension) but whole Twitter Bootstrap issue. Submenus are always opened on hover, not mouse click, which makes them completely unusable in mobile devices.

Look for my answer here. The only workaround I found is to set collapse to true. This will change menu on smaller screens into nice collapsible widget. But it will most likely fail on large screens, like your mentioned iPad.

I can't understand how it is possible, that developers in such big and wide known project has omitted so extremely obvious thing? But, the facts are as they're. Twitter Bootstrap has currently no support for submenus on mobile devices. Maybe they assumed, that you won't use submenus on pages for mobile devices and though you should limit yourself into one-level menu structure there? I don't know.

This question was already asked by me in this forum (look here). So try to use a search before reposting the same question. Simple "bootstrap submenu" search should reveal you, that this question was already asked.

As I found myself, this is not Yii-Bootstrap (Chris extension) but whole Twitter Bootstrap issue. Submenus are always opened on hover, not mouse click, which makes them completely unusable in mobile devices.

Look for my answer here. The only workaround I found is to set collapse to true. This will change menu on smaller screens into nice collapsible widget. But it will most likely fail on large screens, like your mentioned iPad.

I can't understand how it is possible, that developers in such big and wide known project has omitted so extremely obvious thing? But, the facts are as they're. Twitter Bootstrap has currently no support for submenus on mobile devices. Maybe they assumed, that you won't use submenus on pages for mobile devices and though you should limit yourself into one-level menu structure there? I don't know.