Added 'Loading...' message to all lists and sublists.

This commit is contained in:
chouseknecht 2013-05-26 23:36:54 -04:00
parent 9e519400bc
commit 2a0f528954
6 changed files with 17 additions and 2 deletions

View File

@ -32,6 +32,7 @@ angular.module('RefreshRelatedHelper', ['RestServices', 'Utilities'])
scope[iterator + 'Count'] = data.count;
scope[iterator + 'PageCount'] = Math.ceil((data.count / scope[iterator + 'PageSize']));
scope[iterator + 'SearchSpin'] = false;
scope[iterator + 'Loading'] = false;
})
.error ( function(data, status, headers, config) {
scope[iterator + 'SearchSpin'] = true;

View File

@ -30,6 +30,7 @@ angular.module('RefreshHelper', ['RestServices', 'Utilities'])
scope[iterator + 'Count'] = data.count;
scope[iterator + 'PageCount'] = Math.ceil((data.count / scope[iterator + 'PageSize']));
scope[iterator + 'SearchSpin'] = false;
scope[iterator + 'Loading'] = false;
scope[set] = data['results'];
scope.$emit('PostRefresh');
})

View File

@ -53,6 +53,8 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat
scope.search = function(model) {
scope[model + 'SearchSpin'] = true;
scope[model + 'Loading'] = true;
var set, url, iterator, default_order;
for (var key in relatedSets) {
if (relatedSets[key].iterator == model) {

View File

@ -97,6 +97,7 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
// need to be able to search by related set. Ex: /api/v1/inventories/?organization__name__icontains=
//
scope[iterator + 'SearchSpin'] = true;
scope[iterator + 'Loading'] = true;
scope[iterator + 'SearchParms'] = '';
var url = defaultUrl;
if ( (scope[iterator + 'SelectShow'] == false && scope[iterator + 'SearchValue'] != '' && scope[iterator + 'SearchValue'] != undefined) ||

View File

@ -701,10 +701,15 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += "</tr>\n";
// Message for when a related collection is empty
html += "<tr class=\"info\" ng-show=\"" + itm + " == null || " + itm + ".length == 0\">\n";
html += "<tr class=\"info\" ng-show=\"" + form.related[itm].iterator + "Loading == false && (" + itm + " == null || " + itm + ".length == 0)\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">No records matched your search.</div></td>\n";
html += "</tr>\n";
// Message for loading
html += "<tr class=\"info\" ng-show=\"" + form.related[itm].iterator + "Loading == true\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">Loading...</div></td>\n";
html += "</tr>\n";
// End List
html += "</tbody>\n";
html += "</table>\n";

View File

@ -252,9 +252,14 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
html += "</tr>\n";
// Message for when a collection is empty
html += "<tr class=\"info\" ng-show=\"" + list.name + " == null || " + list.name + ".length == 0\">\n";
html += "<tr class=\"info\" ng-show=\"" + list.iterator + "Loading == false && (" + list.name + " == null || " + list.name + ".length == 0)\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">No records matched your search.</div></td>\n";
html += "</tr>\n";
// Message for loading
html += "<tr class=\"info\" ng-show=\"" + list.iterator + "Loading == true\">\n";
html += "<td colspan=\"" + cnt + "\"><div class=\"alert alert-info\">Loading...</div></td>\n";
html += "</tr>\n";
// End List
html += "</tbody>\n";