[Solved]Prevent deselect on CGridView

AFAIK, on CGridView, we click once it will select the column. And if we select once again on the same column, it will unselected the column. I want to override the CGridView, so if the user click once again on a selected column, it won’t unselect the column. Where should I change it? I personally don’t think to change it on assets folder.

Thanks before…

Later I change it on asset folder. Because I don’t found any place yet.

I go to to assets/5f1769c/gridview/jquery.yiigridview.js

and go to this line




$('#'+id+' .'+settings.tableClass+' > tbody > tr').live('click',function(){

					if(settings.selectableRows == 1)

						$(this).siblings().removeClass('selected');

                                        $(this).toggleClass('selected');

					if(settings.selectionChanged != undefined)

						settings.selectionChanged(id);

				});



to this




$('#'+id+' .'+settings.tableClass+' > tbody > tr').live('click',function(){

					if(settings.selectableRows == 1)

						$(this).siblings().removeClass('selected');

                                        [b]$(this).addClass('selected');[/b]

					if(settings.selectionChanged != undefined)

						settings.selectionChanged(id);

				});



so it solved the problem…

This is really an old post, but, it’s important to say it: don’t edit published assets. Edit the source files. Always.