This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Extends one class to create a subclass and optionally overrides members with the passed literal. This method also adds the function "override()" to the subclass that can be used to override members of the class. | |
| For example, to create a subclass of Ext GridPanel: | |
| MyGridPanel = Ext.extend(Ext.grid.GridPanel, { | |
| constructor: function(config) { | |
| // Create configuration for this Grid. | |
| var store = new Ext.data.Store({...}); | |
| var colModel = new Ext.grid.ColumnModel({...}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I fixed it (for now) by adding the following to the parent panel, even though it's laggy... | |
| listeners: { | |
| resize: function() { | |
| Ext.each(this.items.items, function(child){ | |
| var w = child.getWidth(); | |
| child.getHeader().setWidth(w); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| As with so many things in ExtJS, the ‘ref’ option introduced in 3.0 is not very well documented, at least as far as I can tell. Which is unfortunate, because it’s extremely useful, and drastically reduces the need for ids. Here’s an example of how to use it: | |
| Ext.onReady(function() { | |
| Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif'; | |
| Ext.QuickTips.init(); | |
| // Define a simple component | |
| MyComponent = Ext.extend(Ext.form.FormPanel, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I find the disabled fields in ExtJS 4 (and 3) too light, especially in Safari/Chrome. Just add this to your application’s CSS file to make them darker: | |
| .x-item-disabled { | |
| color: #888888 !important; | |
| -moz-opacity: 100; | |
| opacity: 1; | |
| } | |
| .x-form-item-label .x-item-disabled { | |
| color: #888888 !important; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A trivial override: | |
| Ext.form.field.Base.override({ | |
| setLabel: function (text) { | |
| if (this.rendered) { | |
| Ext.get(this.labelEl.id).update(text); | |
| } | |
| this.fieldLabel = text; | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Давайте посмотрим, как создается новая модель. | |
| Ext.define('User', { | |
| extend: 'Ext.data.Model', | |
| fields: [ | |
| { name: 'id', type: 'int' }, | |
| { name: 'name', type: 'string' } | |
| ] | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| items = items.concat( | |
| { | |
| xtype: 'component', | |
| cls: 'fieldset-margin-right10px', | |
| html: '<a href="">Указать/Изменить</a>', | |
| listeners: { | |
| render: function (cmp) { | |
| var onCLick = function() { | |
| Docu.modules.edi.view.docs.DocumentMemberForm.showFor(me.current, me.formParams); |