In YiiBootstrap TbGridView, the columns headers are defaulting with ^ for sorting like this.
Its mentioned in the file \protected\extensions\bootstrap\widgets\TbDataColumn.php on the line 28 like
if ($sort->resolveAttribute($this->name) !== false)
$label .= '<span class="caret"></span>';
Because of this its showing as column header with down arrow next to the label.
I want my column headers not to have the caret symbol next to them, but I don’t want to change this in the source widget as it would mean we would have issues updating the extension in future.
Is there any way to do this with the properties on the TbGridView widget itself?
If you don’t want to disable sorting on that column (which would get rid of it too), then your only way really is to use your own widget. As the
TbDataColumnclass is, for some reason, hard coded into the TbGridView. (you can see here Source)You can inherit from the
TbGridView, override that function and replace it with a function that calls yourEDataColumnclass instead. Then you can do the same with theETbDataColumninherit from theTbDataColumnand just override the function you need.e.g.
But if your feeling in a giving back mood, you can always alter the YiiBootstrap
TbGridViewto use a parameter to determine which column class to use, and submit a pull request to YiiBootstrap here: https://bitbucket.org/Crisu83/yii-bootstrap/pull-requestsTo get the change put in the source code and solve this problem for everyone else too 🙂