`
eimhee
  • 浏览: 2114414 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Extending a JSON schema - Ext JS

阅读更多
Jack,

Could you please suggest the best way to approach this problem.

We are processing updates from an editable grid in our application server. However some of the updates may fail validation in the app server. So the failed updates are sent back to the browser and re-applied to the grid. Hence the user can see the modifications that failed.

To achieve this we return the failed updates as well as the grid contents in the JSON. I subclassed the Ext.data.JsonReader and overrode readRecords to extract the failed updates from the response. My reader stashes the updates with the grid for processing by a data store load listener. This largely works but has a strange effect.

Following a response with some failed updates, subsequent requests are issued multiple times. The number of duplicate requests increases as more responses are received.

So my key question is how should I go about modifying the JSON handling.

Thanks for any and all suggestions,

Regards,

Gordon

Update: This behaviour is only provoked after the server responds with a HTTP 500 or other error. So I'm now considering how loadExceptions are handled.
Reply With Quote
  #2  
Old 03-14-2007, 01:26 PM
Default

It's hard to say without seeing some code. To me, it sounds like you might be attaching or instantiating something within an event handler which would cause it to show up multiple times with the number of times increasing with the number of times that event handler is called.
Reply With Quote
  #3  
Old 03-15-2007, 09:43 AM
DefaultIssue resolved

I've fixed this bug. It was a problem in my code.

Basically multiple handlers were being added to a button. There was a boolean variable which was supposed to prevent this but it was sometimes null rather than true or false.

Regards,

Gordon
Reply With Quote
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics