Ext miscellany 整理

来源:互联网 发布:cms哪个好 编辑:程序博客网 时间:2024/06/18 18:05

Initial a load mask.

newExt.LoadMaskel, config ) :

Parameters

  • el : Mixed

    The element or DOM node, or its id

  • config : Object

    The config object

Ext相关链接 http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.LoadMask


使用query获取store中的records

query( field, value, [anyMatch], [caseSensitive] ) : MixedCollection

Query the records by a specified property.

Parameters

  • field : String

    A field on your records

  • value : String/RegExp

    Either a string that the field should begin with, or a RegExp to test against the field.

  • anyMatch : Boolean (optional)

    True to match any part not just the beginning

  • caseSensitive : Boolean (optional)

    True for case sensitive comparison

Returns

  • MixedCollection

    Returns an Ext.util.MixedCollection of the matched records

可以从得到的collection中继续获取data

如: store.query('attributeId', primaryKey).get(0).get('attributeName');得到的是attributeId是primaryKey中attributeName的值。

Ext相关链接 http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.data.Store


设置Component的可见性


setVisible( visible ) : 
Convenience function to hide or show this component by boolean.

如:Ext.getCmp('compId').setVisible(true);

另一种方法,在item里配hidden属性

hidden : Boolean

Render this component hidden (default is false). If true, the hide method will be called internally.


销毁Component


destroy( )

Destroys this component by purging any event listeners, removing the component's element from the DOM, removing the component from its Ext.Container (if applicable) and unregistering it from Ext.ComponentMgr. Destruction is generally handled automatically by the framework and this method should usually not need to be called directly.


设置元素为只读,不可编辑

disabled : true


设置最大输入长度

maxLength : Number

Maximum input field length allowed by validation (defaults to Number.MAX_VALUE). This behavior is intended to provide instant feedback to the user by improving usability to allow pasting and editing or overtyping and back tracking.

maxLengthText : String

Error text to display if the maximum length validation fails (defaults to 'The maximum length for this field is {maxLength}')

Ext相关链接 http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.form.TextField-cfg-maxLength

0 0
原创粉丝点击