Extending a JSON schema - Ext JS

作者在使用ExtJS处理应用服务器返回的可编辑网格更新时遇到问题,部分更新未能通过验证并被重新发送到浏览器。为了解决由此引发的多次重复请求问题,作者详细描述了问题现象并寻求解决方案。最终发现问题是由于按钮处理程序被多次添加所导致。
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
WARNING - Doc file 'reference/icons-emojis.md' contains a link '../customization.md#additional-css', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'reference/icons-emojis.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'reference/images.md' contains a link '../assets/images/zelda-light-world.png#only-light', but the target 'assets/images/zelda-light-world.png' is not found among documentation files. WARNING - Doc file 'reference/images.md' contains a link '../assets/images/zelda-dark-world.png#only-dark', but the target 'assets/images/zelda-dark-world.png' is not found among documentation files. WARNING - Doc file 'setup/adding-a-comment-system.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/adding-a-comment-system.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/adding-a-comment-system.md' contains a link '../customization.md#overriding-partials', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/changing-the-colors.md' contains a link '../customization.md#additional-css', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/changing-the-fonts.md' contains a link '../customization.md#additional-css', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/changing-the-language.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/changing-the-logo-and-icons.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/ensuring-data-privacy.md' contains a link '../customization.md#additional-javascript', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-a-blog.md' contains a link '../creating-your-site.md#previewing-as-you-write', but the target 'creating-your-site.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-a-blog.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-navigation.md' contains a link '../customization.md#additional-javascript', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-navigation.md' contains a link '../customization.md#additional-css', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-site-analytics.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-site-analytics.md' contains a link '../customization.md#additional-javascript', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-the-footer.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-the-footer.md' contains a link '../customization.md#overriding-partials', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-the-header.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-the-header.md' contains a link '../customization.md#overriding-blocks', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-versioning.md' contains a link '../customization.md#extending-the-theme', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/setting-up-versioning.md' contains a link '../customization.md#overriding-blocks', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/extensions/python-markdown-extensions.md' contains a link '../../customization.md#additional-javascript', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/extensions/python-markdown-extensions.md' contains a link '../../customization.md#additional-javascript', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'setup/extensions/python-markdown-extensions.md' contains a link '../../customization.md#additional-css', but the target 'customization.md' is not found among documentation files. WARNING - Doc file 'tutorials/index.md' contains a link '../getting-started.md', but the target 'getting-started.md' is not found among documentation files. WARNING - Doc file 'tutorials/index.md' contains a link '../creating-your-site.md', but the target 'creating-your-site.md' is not found among documentation files.
08-28
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值