I referred to the sample code stated in here and I have amended the following code
data = {items: [
{showItem:true, name:"Johnny Depp2"},
{showItem:false, name:"Henry Best"}
]}
to
data = {},
helpers = {
updateItem: function(ev) {
$.observable(this).setProperty("showItem", !this.showItem);
}
};
setTimeout(function () {
data = {items: [
{showItem:true, name:"Johnny Depp2"},
{showItem:false, name:"Henry Best"}
]}
}, 1000);
but I found the initial data could not be loaded, could anyone teach me how to do this? I am simulating the Ajax page load, thanks very much.