문제

I am using YiiBooster extensions --> TbExtendedGridView --> The Grid/Chart switcher in my application. Grid/Chart Switch

So by default it displays the Grid view and we can select chart option too. Does anyone know how can I change it to chart as the default view when the page is loaded.

I was looking into TbExtendedGridView.php but did not find how to change that. I would really appreciate if you could help me on this.

Thanks.

도움이 되었습니까?

해결책 2

They added this property in the chartOptions in the extension on request.

.defaultView, which is a flag used to set the chart as the default view of the widget

The Grid/Chart switcher

Thanks for all the help

다른 팁

There is no out of the box support for what you are asking but we can use JS to implement this functionality

When you create this TbExtendedGridView note down the class name or unique ID of your 'Chart' button and on page load put the following JS :-

$('.chart.btn').trigger('click'); //user ID or class names as selector in jQuery

This will trigger a click event on the chart button and you will get chart view by default.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top