私はそのようなテーブルを生成しています:
<div class="table zebra-striped selectable">
{{#each "App.accidentsController.content"}}
{{view App.AccidentView contentBinding="this"}}
{{/each}}
</div>
このようなものはどこにApp.AccidentView
ありますか:
<div {{action tbodyClick this target='this'}} class="tr accident">
<div class="td w03pr">{{unbound [1]}}</div>
<div class="td">{{unbound [3]}}</div>
<div class="td">{{unbound [4]}}</div>
</div>
行数が数百または数千になる可能性があるため、パフォーマンスの問題を検討しているため、行のバインディングを使用しておらず、現時点ではContainerView
真剣に検討していません(またはすべきですか?)。行データを操作した後、すべての行の html を置き換えたいだけです。私は行テンプレートとそのコンテキストを持っています。最もシンプルで効果的な方法は、行のhtmlを新しいものに置き換えるだけで、ドキュメントに従って次のようなことができます:
var newView=App.AccidentView.create(newContext);
newView.appendTo('div.table');
しかしappend
、古い行の代わりに配置する必要があるだけでは不十分です-jQueryのreplaceWithのようなものです。tr
だから私の質問は、これを行う適切な方法は何ですか-ビューまたは使用のタグを何らかの方法でトリミングしますContainerView
が、パフォーマンスはどうですか? 洞察をありがとう。