약 200 개국의 드롭 다운 합성보기 모음을 표시 할 때 내 응용 프로그램이 너무 느려집니다.백본 Marionette 천천히 합성보기 (200+ 모음)
대형 합성보기에서 대형 컬렉션을 처리 할 때 성능을 향상시키는 가장 좋은 방법은 무엇입니까?
컨트롤러의로드가 매우 느린 기능입니다. 다음 줄만 제거하면 빠릅니다.
@layout.shippingCountryRegion.show shippingCountryView
@layout.billingCountryRegion.show billingCountryView
이렇게 렌더링 문제가 매우 느립니다.
Show.Controller =
showProfile: ->
@layout = @getLayoutView()
@layout.on "show", =>
headerView = @getHeaderView()
@layout.headerRegion.show headerView
accessView = @getAccessView()
@layout.accessRegion.show accessView
billingReadmeView = @getBillingReadmeView()
@layout.billingReadmeRegion.show billingReadmeView
billingFieldsView = @getBillingFieldsView()
@layout.billingFieldRegion.show billingFieldsView
shippingReadmeView = @getShippingReadmeView()
@layout.shippingReadmeRegion.show shippingReadmeView
shippingFieldsView = @getShippingFieldsView()
@layout.shippingFieldRegion.show shippingFieldsView
MyApp.request "location:get_countries", (countries) =>
billingCountryView = @getBillingCountryView(countries)
@layout.billingCountryRegion.show billingCountryView
MyApp.request "location:get_states", MyApp.activeCustomer.get('billing_country_id'), (states) =>
billingStateView = @getBillingStatesView(states)
@layout.billingStateRegion.show billingStateView
MyApp.request "location:get_countries", (countries) =>
shippingCountryView = @getShippingCountryView(countries)
@layout.shippingCountryRegion.show shippingCountryView
MyApp.request "location:get_states", MyApp.activeCustomer.get('shipping_country_id'), (states) =>
shippingStateView = @getShippingStatesView(states)
@layout.shippingStateRegion.show shippingStateView
MyApp.mainRegion.show @layout
과금 국가보기 : 단순히
class View.BillingCountryDropdownItem extends MyApp.Views.ItemView
template: billingCountryItemTpl
tagName: "option"
onRender: ->
this.$el.attr('value', this.model.get('id'));
if MyApp.activeCustomer.get('billing_country_id') == this.model.get('id')
this.$el.attr('selected', 'selected');
class View.BillingCountryDropdown extends MyApp.Views.CompositeView
template: billingCountryTpl
itemView: View.BillingCountryDropdownItem
itemViewContainer: "select"
템플릿 :
<label>Country
<select id="billing_country_id" name="billing_country_id">
<%- name %>
</select>
</label>
가 빠른 솔루션이 필요합니다. 감사.
가 왜'onRender' 방법에서 모델의 값을 설정하는? –
그리고 복합 템플릿 내부에 <%- name %>은 무엇입니까? –