Jak przedłużyć niestandardowy model w extjs.Rozszerz od niestandardowej klasy modelu w ExtJS 4
Czy istnieje metoda, która może bezpośrednio zabandażować pola pól User i BusinessUser, gdy będę odsyłać pola z klasy BusinessUser w poniższym przykładzie.
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name: 'name', type: 'string'},
{name: 'age', type: 'int'},
{name: 'phone', type: 'string'},
{name: 'alive', type: 'boolean', defaultValue: true}
],
});
Ext.define('BusinessUser', {
extend: 'User',
fields: [
{name: 'businessType', type: 'string'},
{name: 'company', type: 'string'}
],
});
Wygląda jak błąd, ale ... 'console.log (Ext.getClassName (bu)); // "BusinessUser" ' ' console.log (Ext.getClassName (u)); // "Użytkownik" ' wypisze' BusinessUser' oba razy , a testy dla 'instanceof' dostarczą odpowiednio dane wyjściowe – bam