From d0e680f70cdf66f7f25842e88d5472d8beedc724 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 10 Apr 2013 18:00:04 -0400 Subject: [PATCH] Fix #519: Ensure OnDemandList displays noDataMessage for async stores --- CHANGES.md | 5 +++++ OnDemandList.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 98efdbe53..a6b67bf45 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,11 @@ This document outlines changes since 0.3.0. For older changelogs, see the ## Significant changes +### General/Core + +* Fixed a regression (present since 0.3.5) in `OnDemandList` which prevented + `noDataMessage` from being displayed for async stores. (#519) + ### Extensions * Fixed a regression in the `ColumnResizer` extension where columns were no diff --git a/OnDemandList.js b/OnDemandList.js index 96041e82d..863f37b3d 100644 --- a/OnDemandList.js +++ b/OnDemandList.js @@ -158,7 +158,9 @@ return declare([List, _StoreMixin], { // Render the result set Deferred.when(self.renderArray(results, preloadNode, options), function(trs){ - return Deferred.when(results.total || results.length, function(total){ + var total = typeof results.total === "undefined" ? + results.length : results.total; + return Deferred.when(total, function(total){ // remove loading node put(loadingNode, "!"); // now we need to adjust the height and total count based on the first result set