Remove unnecessary default-sort/ default-sort-reverse from hz-table
The <th> already uses st-sort-default attribute (which you can also set to 'reverse'), so we don't need to define it again for hz-table directive and have it call stTableController's internal sortBy. Change-Id: Idf155efcfc97fdf52e81cb0ea06d246412e948ee
This commit is contained in:
parent
aba6d1f0da
commit
eac7e3ae84
@ -10,8 +10,6 @@
|
||||
st-magic-search
|
||||
st-table="items"
|
||||
st-safe-src="safeSrcItems"
|
||||
default-sort="name"
|
||||
default-sort-reverse="false"
|
||||
class="table table-striped table-rsp table-detail">
|
||||
<thead>
|
||||
<!--
|
||||
|
@ -26,9 +26,7 @@
|
||||
* @description
|
||||
* The `hzTable` directive extends the Smart-Table module to provide
|
||||
* support for saving the checkbox selection state of each row in the
|
||||
* table. A default sort key can be specified to sort the table
|
||||
* initially by this key. To reverse, add default-sort-reverse='true'
|
||||
* as well.
|
||||
* table.
|
||||
*
|
||||
* Required: Use `st-table` attribute to pass in the displayed
|
||||
* row collection and `st-safe-src` attribute to pass in the
|
||||
@ -68,18 +66,8 @@
|
||||
require: 'stTable',
|
||||
scope: true,
|
||||
controller: 'TableController',
|
||||
controllerAs: 'tCtrl',
|
||||
link: link
|
||||
controllerAs: 'tCtrl'
|
||||
};
|
||||
return directive;
|
||||
|
||||
///////////////////
|
||||
|
||||
function link(scope, element, attrs, stTableCtrl) {
|
||||
if (attrs.defaultSort) {
|
||||
var reverse = attrs.defaultSortReverse === 'true';
|
||||
stTableCtrl.sortBy(attrs.defaultSort, reverse);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
@ -8,8 +8,6 @@
|
||||
hz-table ng-cloak
|
||||
st-table="table.iflavors"
|
||||
st-safe-src="table.flavors"
|
||||
default-sort="ram"
|
||||
default-sort-reverse="false"
|
||||
class="table table-striped table-rsp table-detail">
|
||||
|
||||
<thead>
|
||||
|
@ -2,8 +2,6 @@
|
||||
hz-table ng-cloak
|
||||
st-table="table.iusers"
|
||||
st-safe-src="table.users"
|
||||
default-sort="name"
|
||||
default-sort-reverse="false"
|
||||
class="table table-striped table-rsp table-detail">
|
||||
|
||||
<thead>
|
||||
|
@ -2,8 +2,6 @@
|
||||
hz-table ng-cloak
|
||||
st-table="table.images"
|
||||
st-safe-src="table.imagesSrc"
|
||||
default-sort="name"
|
||||
default-sort-reverse="false"
|
||||
class="table table-striped table-rsp table-detail">
|
||||
<thead>
|
||||
<tr>
|
||||
|
Loading…
Reference in New Issue
Block a user