Created
August 25, 2017 22:55
-
-
Save raybelisle/b490fb74bee57ceb30f48811cece0511 to your computer and use it in GitHub Desktop.
Alloy ListView Template Example - Showing a message when no data is available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateListView(records) { | |
if (records === 0) { | |
var item = $.postsList.sections[0].getItemAt(0); | |
item.template = 'noDataTemplate'; | |
$.postsList.sections[0].updateItemAt(0, item); | |
} else { | |
var item = $.postsList.sections[0].getItemAt(0); | |
item.template = 'zero'; | |
$.postsList.sections[0].updateItemAt(0, item); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment