Can I override just one table header and not all?
See original GitHub issueHi, Can I override just one table header and not all? I want a sortable table with a custom first column (a fancy checkbox first column). Right now all the logic in the sorting is in tbody > tr. I do not have thead > th and this is how my code looks like:
<tbody>
<tr ng-repeat="foo in fooList">
<td data-title="'Name'" class="" data-sortable="'name'">
And now my code looks like this
<thead>
<!--custom first column header-->
<!--boilerplate header-->
<th ng-class="{
'sort-asc': tableParams.isSortBy('name', 'asc'),
'sort-desc': tableParams.isSortBy('name', 'desc')
}"
ng-click="tableParams.sorting({'name' : tableParams.isSortBy('name', 'asc') ? 'desc' : 'asc'})">
<div>Name</div>
</th>
<!--the rest of the column definitions which are similar to the previous one-->
</thead>
<tbody>
<!--custom first column data-->
<tr ng-repeat="foo in fooList">
<td data-title="'Name'" class="" data-sortable="'name'">
I did so because I followed this example: http://bazalt-cms.com/ng-table/example/18 Is there any way I can have a simple default sortable column (like I used to have in my first example) and have custom stuff only in the first one? I have lots of columns and the boilerplate sortable stuff complicates my code a lot and it is not DRY.
A workaround is to make my own custom directive for the header but I was hoping there is a simpler solution.
Thank you!
Issue Analytics
- State:
- Created 9 years ago
- Comments:6
Top Results From Across the Web
How do I override css class for header row only but keep rest ...
Simply remove the first row's class from the selector, using the :not () ... You can use the same concept to the other...
Read more >Table panel: Column header overrides are ignored #18711
On 6.3.3. it is not possible to override column headers when using the table panel. This query should show Erzeugung and Bezug as...
Read more >Overriding a Row or Column Heading
To override a specific row or column heading in the grid: ... In Heading Row Properties or Heading Column Properties, select Custom Heading,...
Read more >A table with both a sticky header and a sticky first column
Here's a video example of a table that sticks both the header and first column: Why would you do that?
Read more >Adding headers and footers to table sections - Apple Developer
Custom header and footer views give the sections of your table a unique appearance. With custom headers and footers, you specify the views...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes you can.
Create a simple custom template like so:
Then define your special column like this:
… instead of this:
Wonderful. Still useful!!!