EXTJS7 publishes將配置屬性映射到viewModel
小編:管理員 293閱讀 2022.09.07
在組件聲明使用publishes
Ext.define('myComponent', { extend: 'Ext.Component', xtype: 'my-component', // 配置屬性,默認不支持組件直接綁定屬性 config: { prop1: null, ... }, publishes: { // 增加此項將配置屬性映射到viewModel prop1: true }, items:[{ ... // 可以直接綁定published映射過的配置屬性 bind: { value: '{prop1}'} ... }] });復制在組件實例使用publishes
{ xtype: 'my-component', reference: 'mycomponent', publishes: ['prop1'] }, { type: 'textfield', bind: 'mycomponent.prop1' }復制
- 如果組件實例不存在reference屬性,則publishes配置將被忽略
相關推薦
- ExtJs七(ExtJs Mvc創建ViewPort) 前言在4.1的時候,要先創建一個擴展于Ext.app.Application的類,然后用create創建它的實例來開始應用程序的。而在4.1.1,則可直接調用application方法開始執行應用程序,簡化了。調用application方法,其參數是一個配置對象,主要配置項有以下三個:name:用來…
- Hibernate Criterion 在查詢方法設計上能夠靈活的依據Criteria的特點來方便地進行查詢條件的組裝.Hibernate設計了CriteriaSpecification作為Criteria的父接口,以下提供了Criteria和DetachedCriteria.Criteria和DetachedCriteria的主要差別在于創建的形式不一樣,Criteria是在線的,所…