1

如果获取集合返回错误,我可以添加不同的视图或布局吗?

现在,我正在这样做:

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({...
    })
}

那么,有没有更好的方法来做到这一点?否则,我将继续使用这种方法,因为即使我想以正确的方式进行操作,它仍然有效。

4

0 回答 0