jqgrid主要的警告同步XMLHttpRequest [英] jqgrid The warning Synchronous XMLHttpRequest on the main

查看:422
本文介绍了jqgrid主要的警告同步XMLHttpRequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

奥列格

相关文章

Relate to this post jqgrid How to use jquery blockUI plugin in inline Save command

我刚刚意识到,我不'不需要同时使用serializeRowData和beforeSaveRow。我正在使用jqGrid 4.7.1,并且点击保存图标时显示保存...消息。

I just realized that i don't need to use both serializeRowData and beforeSaveRow. I'm using jqGrid 4.7.1 and the "Saving..." message has showed when the 'Save' icon is clicked.

但似乎只是Firefox工作良好(我的意思是Saving ...消息显示),My Chrome无法正常工作(正在保存... 消息不显示)。
主线程上的警告同步XMLHttpRequest已被弃用,因为它对最终用户的体验有不利影响。有关更多帮助,请查看
http://xhr.spec.whatwg.org/ 。显示在我的Chrome上。我认为这就是没有显示Saving ...消息的原因。

But it seems just only Firefox working good (I mean the "Saving..." message is showed), My Chrome is not working (the "Saving..." message is NOT showed). The warning "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/." is displayed on my Chrome. I think this is the reason the "Saving..." message is NOT showed.

我认为Saving ...消息是jqgrid的一个存在特征,我们不需要自定义消息或类似的东西。 (不需要同时使用serializeRowData和beforeSaveRow)

I think "Saving..." message is an exist feature of jqgrid and we don't need to have a custom message or something like that. (don't need to use both serializeRowData and beforeSaveRow)

所以,我的问题是为什么Chrome会触发上面的警告?

So, my question is why Chrome is fire the warning above ?

非常感谢您

推荐答案

我建议您使用 ajaxRowOptions b

I recommend you to use ajaxRowOptions option of jqGrid to set async: true option:

ajaxRowOptions: { async: true }

主要区别在于 saveRow 方法将不会返回正确的值( true false ),但该值很少使用。只有 inlineNav 格式化程序:actions jqGrid 4.7.x使用返回值并隐藏/显示/启用/禁用相应的编辑按钮。如果您使用 inlineNav 格式化程序:actions,您只需在回调句柄中添加一些附加代码即可隐藏/显示/启用/禁用相应的编辑按钮。

The main difference will be that saveRow method will don't return correct value (true or false), but the value will be seldom used. Only inlineNav and formatter: "actions" of jqGrid 4.7.x use the returned value and hide/show/enable/disable the corresponding editing buttons. If you use inlineNav or formatter: "actions" you will just need to add some additional code in your callback handles to hide/show/enable/disable the corresponding editing buttons.

顺便说一句,我正在开发 jqGrid的新免费版本,并且已经重写了 inlineNav 格式化器的某些部分:actions。更改编辑按钮状态的问题不存在。因此,我将在我的存储库中从 saveRow 删除今天的行 async:false ,以便它在默认情况下可以异步工作。

By the way I'm developing new free version of jqGrid and have already rewritten some parts of inlineNav or formatter: "actions". The problem with changing the states of editing buttons not exist more. So I'll remove today the line async: false from saveRow in my repository so that it will works asynchronous by default.

这篇关于jqgrid主要的警告同步XMLHttpRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆