Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 架构师将存储同步到Web服务_Javascript_Json_Extjs_Submit - Fatal编程技术网

Javascript 架构师将存储同步到Web服务

Javascript 架构师将存储同步到Web服务,javascript,json,extjs,submit,Javascript,Json,Extjs,Submit,我想将已在表单的某些字段中编辑的设置同步到服务器 Firebug显示:无,单击按钮时无连接。 JavaScript控制台显示:无错误 我所拥有的: onButtonClick: function(button, e, eOpts) { Ext.getStore("optionsStore").getAt(0).setDirty(); Ext.getStore("optionsStore").commitChanges(); Ext.getStore("optionsSto

我想将已在表单的某些字段中编辑的设置同步到服务器

Firebug显示:无,单击按钮时无连接。
JavaScript控制台显示:无错误

我所拥有的:

onButtonClick: function(button, e, eOpts) {
    Ext.getStore("optionsStore").getAt(0).setDirty();
    Ext.getStore("optionsStore").commitChanges();
    Ext.getStore("optionsStore").sync();
}
我用于加载:

onJsonstoreLoad: function(store, records, successful, eOpts) {
    Ext.getCmp("optionsForm").getForm().loadRecord(store.getAt(0));
}
我的商店是由建筑师建造的:

constructor: function(cfg) {
    var me = this;
    cfg = cfg || {};
    me.callParent([Ext.apply({
        autoLoad: true,
        model: 'optionsModel',
        storeId: 'optionsStore',
        proxy: {
            type: 'ajax',
            api: 'read: \'http://localhost:52699/api/AdminPanel?do=select\',\r\ncreate: \'http://localhost:52699/api/AdminPanel?do=insert\',\r\nupdate: \'http://localhost:52699/api/AdminPanel?do=update\',\r\ndestroy: \'http://localhost:52699/api/AdminPanel?do=delete\'',
            url: 'allSettings.json',
            reader: {
                type: 'json',
                root: 'globalSettings'
            },
            writer: {
                type: 'json',
                allowSingle: false,
                encode: true,
                root: 'globalSettings'
            }
        },
        listeners: {
            load: {
                fn: me.onJsonstoreLoad,
                scope: me
            }
        }
    }, cfg)]);
},
这很简单:

onButtonClick: function(button, e, eOpts) {
    Ext.getCmp("optionsForm").getForm().updateRecord(Ext.getStore("optionsStore").getAt(0));
    Ext.getStore("optionsStore").getAt(0).setDirty();
    Ext.getStore("optionsStore").commitChanges();
    Ext.getStore("optionsStore").sync();
}