My app shows a list of contact information. If the list is empty, the user sees a message telling them to add more contacts.
First, I created a label, with the text "Contact list empty. Add more contacts". Visible checkbox is unchecked.
When listService is invoked on PageShow, on success run javascript
codeif (data.length == 0) {
$("#Status_empty_label1").addClass("emptyDataSet");
}/code
CSS asset:
code.emptyDataSet {
visibility: visible;
}/code
This does not work.
I tried doing it the opposite way by checking the visible checkbox and using CSS asset
code.emptyDataSet {
visibility: hidden;
}/code
and javascript
codeif (data.length != 0) {
$("#Status_empty_label1").addClass("emptyDataSet");
}/code and it works.
My question is how do I do it using the first method? The second method is ugly because the text is visible for a split second before the javascript is executed to hide visibility.