コレクションのフェッチでエラーが返された場合、別のビューまたはレイアウトを追加できますか?
現在、私は次のようにしています。
this.artistsCollection.fetch({
error: function() {
$('div.artistsDiv').append('<div class="tc"><span class="font-entypo icon-three-dots emptystate-big"></span></div>');
}
});
しかし、私は次のようなことを考えていました:
error: function() {
App.useLayout('artistLetter', 'artistLetter').setViews({
'.navMenu': this.navigation,
'.alphabet': this.alphabet,
'.artistsDiv': this.artists
}).render();
}
また
error: function() {
$('div.artistsDiv').setViews({...
})
}
それで、これを行うより良い方法はありますか?それ以外の場合は、正しい方法で実行したいのに機能するため、この方法を続行します..