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-magic-search
|
||||||
st-table="items"
|
st-table="items"
|
||||||
st-safe-src="safeSrcItems"
|
st-safe-src="safeSrcItems"
|
||||||
default-sort="name"
|
|
||||||
default-sort-reverse="false"
|
|
||||||
class="table table-striped table-rsp table-detail">
|
class="table table-striped table-rsp table-detail">
|
||||||
<thead>
|
<thead>
|
||||||
<!--
|
<!--
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
* @description
|
* @description
|
||||||
* The `hzTable` directive extends the Smart-Table module to provide
|
* The `hzTable` directive extends the Smart-Table module to provide
|
||||||
* support for saving the checkbox selection state of each row in the
|
* support for saving the checkbox selection state of each row in the
|
||||||
* table. A default sort key can be specified to sort the table
|
* table.
|
||||||
* initially by this key. To reverse, add default-sort-reverse='true'
|
|
||||||
* as well.
|
|
||||||
*
|
*
|
||||||
* Required: Use `st-table` attribute to pass in the displayed
|
* Required: Use `st-table` attribute to pass in the displayed
|
||||||
* row collection and `st-safe-src` attribute to pass in the
|
* row collection and `st-safe-src` attribute to pass in the
|
||||||
@ -68,18 +66,8 @@
|
|||||||
require: 'stTable',
|
require: 'stTable',
|
||||||
scope: true,
|
scope: true,
|
||||||
controller: 'TableController',
|
controller: 'TableController',
|
||||||
controllerAs: 'tCtrl',
|
controllerAs: 'tCtrl'
|
||||||
link: link
|
|
||||||
};
|
};
|
||||||
return directive;
|
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
|
hz-table ng-cloak
|
||||||
st-table="table.iflavors"
|
st-table="table.iflavors"
|
||||||
st-safe-src="table.flavors"
|
st-safe-src="table.flavors"
|
||||||
default-sort="ram"
|
|
||||||
default-sort-reverse="false"
|
|
||||||
class="table table-striped table-rsp table-detail">
|
class="table table-striped table-rsp table-detail">
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
hz-table ng-cloak
|
hz-table ng-cloak
|
||||||
st-table="table.iusers"
|
st-table="table.iusers"
|
||||||
st-safe-src="table.users"
|
st-safe-src="table.users"
|
||||||
default-sort="name"
|
|
||||||
default-sort-reverse="false"
|
|
||||||
class="table table-striped table-rsp table-detail">
|
class="table table-striped table-rsp table-detail">
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
hz-table ng-cloak
|
hz-table ng-cloak
|
||||||
st-table="table.images"
|
st-table="table.images"
|
||||||
st-safe-src="table.imagesSrc"
|
st-safe-src="table.imagesSrc"
|
||||||
default-sort="name"
|
|
||||||
default-sort-reverse="false"
|
|
||||||
class="table table-striped table-rsp table-detail">
|
class="table table-striped table-rsp table-detail">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user