junxiong
(Junxiong)
September 8, 2010, 5:30pm
1
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…
junxiong
(Junxiong)
September 11, 2010, 5:07am
2
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…
MetaYii
(Metayii Framework)
March 15, 2013, 3:39pm
3
This is really an old post, but, it’s important to say it: don’t edit published assets. Edit the source files. Always.