Hello!
I have this model folder structure:
Code:
- app
- model
- employees
- Employees.js
- dictionaries
- positions
- Positions.js
- Base.js
So I have 'MyApp.model.dictionaries.positions.Positions' and 'MyApp.model.employees.Employees' class names.
Base.js content:
PHP Code:
Ext.define('MyApp.model.Base', {
extend: 'Ext.data.Model',
schema: {
namespace: 'MyApp.model',
}
});
So my entityName of both class becomes 'dictionaries.positions.Positions' and 'employees.Employees'. How can I change them to simple 'Positions' and 'Employees' etc without setting entityName property in each file?
Also if I add some lines to schema section, my api url becomes broken:
PHP Code:
proxy: {
type: 'api',
url: MyApp.Global.getApiUrl() + 'api/v1/{entityName:uncapitalize}'
}
Maybe I can also use regex here to get name after the last dot? How?