[英]How to make EXT JS model and proxy store work? (please_help!)
我還沒有理解如何使用 REST api 鏈接服務器數據和表單的字段。
我有一些選擇字段的表格。 我在服務器上有這個特別字段的值。 我認為表單可以從商店模型中獲取數據(是/否?)。 如果是真的,我有一個問題:如何將現有表單添加到模型中? 所以主要目標 - 從服務器獲取值到存在形式 trought REST API 的存在選擇字段。
這是我現在所擁有的:-代理商店:
Ext.define('Foresto.store.RESTstore',{
extend: 'Ext.data.Store',
storeID:'reststore',
proxy: {
type:'rest',
url:'http://localhost:6666/api/form',
reader:{
type: 'json',
root: ''
}
},
autoLoad: true});
- 形式之一:
Ext.define('Foresto.view.forms.Cutarea', {
extend: 'Ext.form.Panel',
title: 'ForestoL',
header: {
cls: 'header-cls',
},
scrollable: true,
xtype: 'forestoL',
url: 'save-form.php',
items: [{
xtype: 'selectfield',
label: 'Field1',
name: 'name'
},{
xtype: 'selectfield',
label: 'Field2',
name: 'allotment'
}] ...
請幫忙! 謝謝,阿圖爾。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.