Skip to content

Commit f06c015

Browse files
authored
show total records in list pages (#483)
1 parent 366ac43 commit f06c015

File tree

34 files changed

+162
-101
lines changed

34 files changed

+162
-101
lines changed

src/Modules/SimplCommerce.Module.Catalog/wwwroot/admin/product-price/product-price-form.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ <h2>{{::vm.translate.get('Product Price Management')}}</h2>
3838
<th></th>
3939
<th></th>
4040
</tr>
41+
<tr>
42+
<th ng-show="!vm.isLoading" colspan="9">{{vm.tableStateRef.pagination.totalItemCount | number:0}} records found</th>
43+
</tr>
4144
</thead>
4245
<tbody ng-show="!vm.isLoading">
4346
<tr ng-repeat="item in vm.products">

src/Modules/SimplCommerce.Module.Catalog/wwwroot/admin/product-price/product-price-form.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@
66

77
/* @ngInject */
88
function ProductPriceFormCtrl(productPriceService, translateService) {
9-
var vm = this,
10-
tableStateRef;
9+
var vm = this;
10+
vm.tableStateRef = {};
1111
vm.translate = translateService;
1212
vm.products = [];
1313

1414
vm.getProducts = function getProducts(tableState) {
15-
tableStateRef = tableState;
15+
vm.tableStateRef = tableState;
1616
vm.isLoading = true;
1717
productPriceService.getProducts(tableState).then(function (result) {
1818
vm.products = result.data.items;
1919
tableState.pagination.numberOfPages = result.data.numberOfPages;
20+
tableState.pagination.totalItemCount = result.data.totalRecord;
2021
vm.isLoading = false;
2122
});
2223
};
2324

2425
vm.save = function save() {
2526
productPriceService.updateProductPrices(vm.products).then(function (result) {
26-
vm.getProducts(tableStateRef);
27+
vm.getProducts(vm.tableStateRef);
2728
toastr.success('Product prices have been updated');
2829
})
2930
.catch(function (response) {

src/Modules/SimplCommerce.Module.Catalog/wwwroot/admin/product/product-list.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2>{{::vm.translate.get('Products')}}</h2>
2626
<tr>
2727
<th>
2828
<div class="form-group">
29-
<input class="form-control" st-search="Name"/>
29+
<input class="form-control" st-search="Name" />
3030
</div>
3131
</th>
3232
<th>
@@ -63,6 +63,9 @@ <h2>{{::vm.translate.get('Products')}}</h2>
6363
<th><st-date-range predicate="CreatedOn" before="query.before" after="query.after"></st-date-range></th>
6464
<th></th>
6565
</tr>
66+
<tr>
67+
<th ng-show="!vm.isLoading" colspan="10">{{vm.tableStateRef.pagination.totalItemCount | number:0}} records found</th>
68+
</tr>
6669
</thead>
6770
<tbody ng-show="!vm.isLoading">
6871
<tr ng-repeat="product in vm.products">

src/Modules/SimplCommerce.Module.Catalog/wwwroot/admin/product/product-list.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66

77
/* @ngInject */
88
function ProductListCtrl(productService, translateService) {
9-
var vm = this,
10-
tableStateRef;
9+
var vm = this;
10+
vm.tableStateRef = {};
1111
vm.translate = translateService;
1212
vm.products = [];
1313

1414
vm.getProducts = function getProducts(tableState) {
15-
tableStateRef = tableState;
15+
vm.tableStateRef = tableState;
1616
vm.isLoading = true;
1717
productService.getProducts(tableState).then(function (result) {
1818
vm.products = result.data.items;
1919
tableState.pagination.numberOfPages = result.data.numberOfPages;
20+
tableState.pagination.totalItemCount = result.data.totalRecord;
2021
vm.isLoading = false;
2122
});
2223
};
@@ -32,7 +33,7 @@
3233
if (result) {
3334
productService.deleteProduct(product)
3435
.then(function (result) {
35-
vm.getProducts(tableStateRef);
36+
vm.getProducts(vm.tableStateRef);
3637
toastr.success(product.name + ' has been deleted');
3738
})
3839
.catch(function (response) {

src/Modules/SimplCommerce.Module.Contacts/wwwroot/admin/contacts/contact-list.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ <h2>Contacts</h2>
3535
<th><st-date-range predicate="CreatedOn" before="query.before" after="query.after"></st-date-range></th>
3636
<th></th>
3737
</tr>
38+
<tr>
39+
<th ng-show="!vm.isLoading" colspan="5">{{vm.tableStateRef.pagination.totalItemCount | number:0}} records found</th>
40+
</tr>
3841
</thead>
3942
<tbody ng-show="!vm.isLoading">
4043
<tr ng-repeat="contact in vm.contacts">

src/Modules/SimplCommerce.Module.Contacts/wwwroot/admin/contacts/contact-list.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@
66

77
/* @ngInject */
88
function ContactListCtrl(contactService, contactAreaService, translateService) {
9-
var vm = this,
10-
tableStateRef;
9+
var vm = this;
10+
vm.tableStateRef = {};
1111
vm.translate = translateService;
1212
vm.contacts = [];
1313

1414
contactAreaService.getContactAreas().then(function (result) {
1515
vm.contactAreas = result.data;
1616
});
1717

18-
vm.getContacts = function getContacts(tableState) {
19-
tableStateRef = tableState;
18+
vm.getContacts = function getContacts(tableState) {
19+
vm.tableStateRef = tableState;
2020
vm.isLoading = true;
21-
contactService.getContacts(tableState).then(function (result) {
21+
contactService.getContacts(tableState).then(function (result) {
2222
vm.contacts = result.data.items
2323
tableState.pagination.numberOfPages = result.data.numberOfPages;
24+
tableState.pagination.totalItemCount = result.data.totalRecord;
2425
vm.isLoading = false;;
2526
});
2627
};
@@ -30,7 +31,7 @@
3031
if (result) {
3132
contactService.deleteContact(contact)
3233
.then(function (result) {
33-
vm.getContacts(tableStateRef);
34+
vm.getContacts(vm.tableStateRef);
3435
toastr.success(contact.name + ' has been deleted');
3536
})
3637
.catch(function (response) {

src/Modules/SimplCommerce.Module.Core/wwwroot/admin/countries/country-list.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ <h2>{{::vm.translate.get('Countries')}}</h2>
2323
<tr>
2424
<th>
2525
<div class="form-group">
26-
<input class="form-control" st-search="Name"/>
26+
<input class="form-control" st-search="Name" />
2727
</div>
2828
</th>
2929
<th></th>
3030
</tr>
31+
<tr>
32+
<th ng-show="!vm.isLoading" colspan="7">{{vm.tableStateRef.pagination.totalItemCount | number:0}} records found</th>
33+
</tr>
3134
</thead>
3235
<tbody ng-show="!vm.isLoading">
3336
<tr ng-repeat="country in vm.countries">
@@ -55,12 +58,12 @@ <h2>{{::vm.translate.get('Countries')}}</h2>
5558
</tbody>
5659
<tbody ng-show="vm.isLoading">
5760
<tr>
58-
<td colspan="4" class="text-center">Loading ... </td>
61+
<td colspan="7" class="text-center">Loading ... </td>
5962
</tr>
6063
</tbody>
6164
<tfoot>
6265
<tr>
63-
<td class="text-center" st-pagination="" st-items-by-page="50" st-displayed-pages="10" colspan="4"></td>
66+
<td class="text-center" st-pagination="" st-items-by-page="50" st-displayed-pages="10" colspan="7"></td>
6467
</tr>
6568
</tfoot>
6669
</table>

src/Modules/SimplCommerce.Module.Core/wwwroot/admin/countries/country-list.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66

77
/* @ngInject */
88
function CountryListCtrl(countryService, translateService, $state) {
9-
var vm = this,
10-
tableStateRef;
9+
var vm = this;
10+
vm.tableStateRef = {};
1111
vm.countries = [];
1212
vm.translate = translateService;
1313

1414
vm.getCountries = function getCountries(tableState) {
15-
tableStateRef = tableState;
15+
vm.tableStateRef = tableState;
1616
vm.isLoading = true;
1717
countryService.getCountries(tableState).then(function (result) {
1818
vm.countries = result.data.items;
1919
tableState.pagination.numberOfPages = result.data.numberOfPages;
20+
tableState.pagination.totalItemCount = result.data.totalRecord;
2021
vm.isLoading = false;
2122
});
2223
};
@@ -36,7 +37,7 @@
3637
if (result) {
3738
countryService.deleteCountry(country)
3839
.then(function (result) {
39-
vm.getCountries(tableStateRef);
40+
vm.getCountries(vm.tableStateRef);
4041
toastr.success(country.name + ' has been deleted');
4142
})
4243
.catch(function (response) {

src/Modules/SimplCommerce.Module.Core/wwwroot/admin/customergroups/customergroup-list.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ <h2>{{::vm.translate.get('Customer Groups')}}</h2>
3333
<th><st-date-range predicate="CreatedOn" before="query.before" after="query.after"></st-date-range></th>
3434
<th></th>
3535
</tr>
36+
<tr>
37+
<th ng-show="!vm.isLoading" colspan="5">{{vm.tableStateRef.pagination.totalItemCount | number:0}} records found</th>
38+
</tr>
3639
</thead>
3740
<tbody ng-show="!vm.isLoading">
3841
<tr ng-repeat="customergroup in vm.customergroups">

src/Modules/SimplCommerce.Module.Core/wwwroot/admin/customergroups/customergroup-list.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66

77
/* @ngInject */
88
function CustomerGroupListCtrl(customergroupService, translateService) {
9-
var vm = this,
10-
tableStateRef;
9+
var vm = this;
10+
vm.tableStateRef = {};
1111
vm.customergroups = [];
1212
vm.translate = translateService;
1313

1414
vm.getCustomerGroups = function getCustomerGroups(tableState) {
15-
tableStateRef = tableState;
15+
vm.tableStateRef = tableState;
1616
vm.isLoading = true;
1717
customergroupService.getCustomerGroups(tableState).then(function (result) {
1818
vm.customergroups = result.data.items;
1919
tableState.pagination.numberOfPages = result.data.numberOfPages;
20+
tableState.pagination.totalItemCount = result.data.totalRecord;
2021
vm.isLoading = false;
2122
});
2223
};
@@ -26,7 +27,7 @@
2627
if (result) {
2728
customergroupService.deleteCustomerGroup(customergroup)
2829
.then(function (result) {
29-
vm.getCustomerGroups(tableStateRef);
30+
vm.getCustomerGroups(vm.tableStateRef);
3031
toastr.success(customergroup.name + ' has been deleted');
3132
})
3233
.catch(function (response) {

0 commit comments

Comments
 (0)