V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hulufei
V2EX  ›  问与答

有没有使用Spine的同学进来解惑一下

  •  
  •   hulufei · Jun 28, 2012 · 4070 views
    This topic created in 5057 days ago, the information mentioned may be changed or developed.
    使用Spine.Model.Ajax, 当save一个model的时候如何处理后台传回来的可能和model结构不一样的json数据?
    比如当后台数据库写入出错的时候我想返回 {flag: 0} 这样的数据, 而原本定义的model里面并没有flag这样一个属性,当请求完成Spine更新model的时候没有把flag合并到model里面,找了一圈没看到在哪里能拿到这个返回的flag。一小段说明代码:



    不知道大家是怎样处理这种情况的
    1 replies    1970-01-01 08:00:00 +08:00
    hulufei
        1
    hulufei  
    OP
       Aug 29, 2012
    找到怎么处理了,还是在这里补上吧

    文档没看仔细,http://spinejs.com/docs/ajax,Custom serialization一节
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   817 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 22:31 · PVG 06:31 · LAX 15:31 · JFK 18:31
    ♥ Do have faith in what you're doing.