Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
Although the GPLv3 has many terms, the most important is that you must provide the source code of your application to your users so they can be free to modify your application for their own needs.
/**
* Класс аналогичен классу Ext.data.proxy.Ajax
* за исключением того, что все запросы этого класса
* выполняются с помощью POST
*/
Ext.define('Ext.data.proxy.Ajax',
{
extend: 'Ext.data.proxy.Ajax',
alias: 'proxy.ajax',
actionMethods:
{
create : 'POST',
read : 'POST',
update : 'POST',
destroy: 'POST'
}
});
Таким образом на класс можно наложить требуемый патч. Очень помогает в борьбе с глюками ExtJS.Ext.application({
name: 'HelloExt',
launch: function() {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
title: 'Hello Ext',
html : 'Hello! Welcome to Ext JS.'
}
]
});
}
});
Примечание переводчика.
Что бы добавить потомка как член класса, можно просто перенести его из конфига...
Ext.Class.registerPreprocessor('default_xtype', function(cls, data) {
var className = data.$className,
re = new RegExp(/^project_name.view./),
xtype;
if (re.test(className) && !data.alias) {
xtype = className.replace(re, '').replace(/\./g, '_').toLowerCase();
data.xtype = cls.xtype = xtype;
data.xtypes = [ xtype ];
data.alias = [ 'widget.' + xtype ];
}
}, true);
Ext.Class.defaultPreprocessors.push('default_xtype');
20 правил, которым стоит следовать, когда начинаете работать с EXT JS & Sencha Touch