Я сейчас пытаюсь подключить Extjs к веб-интерфейсу API отдыха вне моего проекта. Это мой взгляд:
Ext.define('mycomponents.view.comboselview', {
extend: 'Ext.container.Container',
id: 'comboview',
alias: 'widget.comboview',
xtype: 'comboview',
requires: [
'mycomponents.model.comboselmodel'
],
items: [
{
xtype: 'combobox',
reference: 'levels',
publishes: 'value',
fieldLabel: 'Choices',
displayField: 'description',
anchor: '-15',
store: {
type: 'levels'
},
minChars: 0,
queryMode: 'local',
typeAhead: true,
labelWidth: 100,
labelAlign : 'right',
width: 265,
allowBlank: false
}
],
initComponent: function () {
this.callParent(arguments);
var that = this;
console.log('!!!!!!!!!!!!!!!!!!!!!!>>>', that.up());
}
});
Вот моя модель:
Ext.define('mycomponents.model.comboselmodel', {
extend: 'Ext.data.Model',
fields: [
{
name: 'id',
mapping: 'pk'
},
{
name: 'description',
type: 'string',
mapping: 'description'
},
{
name: 'levelid',
type: 'integer',
mapping: 'levelid'
},
...
]
});
и мой магазин:
Ext.define('mycomponents.store.comboselstore', {
extend: 'Ext.data.Store',
alias: 'store.levels',
model: 'mycomponents.model.comboselmodel',
storeId: 'levels',
restful: true,
autoLoad: true,
proxy: {
type: 'ajax',
headers: {
'Accept': '*/*',
'Cache-Control': 'no-cache',
'Content-Type': 'application/json',
'Authorization': localStorage.token
},
extraParamas: {
sort: 'description',
filter: {
idlevel: {
'null': -1
}
}
},
reader: new Ext.data.JsonReader({
}),
writer: new Ext.data.JsonWriter({
}),
actionMethods: {
read: 'GET'
},
api: {
read: 'apiurl',
create: 'apiurl',
update: 'apiurl',
destroy: 'apiurl'
},
autoSave: true
},
constructor: function (config) {
this.callParent([config]);
console.log('I am entering here!!!')
}
});
Я пытаюсь получить ресурсы из моего apiurl
, который является API для веб-отдыха. Мне нужно отправить некоторые параметры, этот код возвращает мне нужные данные, но этот подход вообще игнорирует extraParamas
. Я не могу сказать, что я вошел в документацию и нашел, как использовать Extjs с остальным API, потому что я не смог найти, как это сделать в официальной документации, поэтому я искал решение и что я ' Мы сделали до сих пор получает фрагменты кода здесь и там. Мой вопрос: как отправить параметры в api отдыха? что я делаю не так?