English 中文(简体)
如何更新储存后的所有财产?
原标题:How to update all properties after store.sync()?

简言之之后,仅更新一行,但并非全部都作出回复。

<<>Model>:

Ext.define( Exp.model.ProfileChannel , {
    extend:  Ext.data.Model ,
    fields: [ id ,  channel ,  server ,  profile ],

    proxy: {
        type:  ajax ,
        api: {
            read:  /profilechannel/list ,
            update:  /profilechannel/save 
        },
        reader: {
            type:  json ,
            root:  data 
        }
    }
});

库存:

Ext.define( Exp.store.ProfileChannels , {
    extend:  Ext.data.Store ,
    model:  Exp.model.ProfileChannel ,
    autoSync: true
});

让我在仓库中说:

{
    id:  1 ,
    profile:  profile id ,
    channel:   ,
    server:   
}

之后:record.set(频道,id );

http://www.ohchr.org。

{
    "success":true,
    "data":[
        {
            id:  1 ,
            profile:  profile id ,
            channel:  channel id ,
            server:  server id added on backend 
        }
    ]
}

最后,我有<>record 类似:

{
    id:  1 ,
    profile:  profile id ,
    channel:  channel id ,
    server:   
}

因此,问题在于我如何更新和服务器价值,我对此有新的价值。 或者我这样做是错误的? 为什么我会把所有财产放在不顾这些财产的地方?

最佳回答

我们应该确切地看待你们的期望。 在更新程序之后从仓库归还的所有记录都应替换您在仓库中可能已经拥有的地方拷贝。 你们可能要检查《外国法院法典》,并去看错。

我肯定使用与ExtJs 4.0.7相同的逻辑。 可能出现的情况是第4.1条破碎的,或可能需要调整贵处/处的某种配置。

问题回答

i 还有一些问题,记录在4.1上作了更新。 经过一些细致的总结发现,在服务器回复中,所有外围模型领域都需要返回!

Exjs确实犯了任何错误,但只是仓储的退约和记录。 很难找到......





相关问题
ExtJS load form items/fields from database

I am using ExtJS 3 here. I would like to populate a formpanel from database with fields to be submitted. Basically, I don t know witch fields my form will have and I want to generate all formpanel ...

How to use Ext JS for role based application

I am planning to use Ext JS for a large application. The application s features are role based. When user login, they only see menu and screen features related to them. My server side technology will ...

Dynamically adding a TabPanel to a Panel Region

I have a Panel layout with a TreePanel in one region. A user clicks on an node in the tree and a TabPanel should be displayed in another region with information, editing tools etc. for that tree node....

How to embed Json result within Extjs Panel?

I have some issues with Json result and embed it within the html of the Extjs Panel. Here s that I have managed to get so far. myPanel is embedded within a mainPanel, and I have some shows/hide of ...

Ajax data update. Extjs

I need to keep certain data ( in a grid) up to date and was gonna do a poll to the server every 15 seocnds or so to get the data and refresh the grid, however it feels a bit dirty ( the grid will have ...

Better way to call superclass method in ExtJS

All the ExtJS documentation and examples I have read suggest calling superclass methods like this: MyApp.MyPanel = Ext.extend(Ext.Panel, { initComponent: function() { // do something MyPanel ...

Merged Headers in Ext JS Grid

Is it possible to have two headers in Ext JS grids? I have to show my grid as grouped data.. for example product types and products. In my case I need a grid like this: Field | Product Type A ...

热门标签