私はバックボーン Web アプリ (バックボーンにはかなり新しい) を介して作業しており、コレクションを取得するときにコレクションを反復処理する際に助けが必要です。私がやりたいことは、コレクション内の各要素をループし、progress
属性がimport を100
表示する場合<div>
、それ以外の場合は loading を表示すること<div>
です。
次のように、コレクションの最後の要素に対してこれを機能させます。
fileRepositoryCollection.fetch({
success: function () {
if (fileRepositoryCollection.at(fileRepositoryCollection.length - 1).get('progress') === 100) {
$('#loading').hide();
$('#imported').show();
} else {
$('#loading').show();
$('#imported').hide();
}
}
});