JqG​​rid EditForm刷新选择 [英] JqGrid EditForm Refresh Select

查看:97
本文介绍了JqG​​rid EditForm刷新选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想刷新我的编辑表单上的选择下拉列表.

I want to refresh a select drop down on my edit form.

此刻我有$("#SalesName").refresh,但这不起作用.我在colModel editoptions:{dataUrl:'SalesDropDownGrid.php'}.

At the moment I have $("#SalesName").refresh but this doesnt work. I have this in the colModel editoptions:{dataUrl:'SalesDropDownGrid.php'}.

感谢您的帮助.

谢谢

推荐答案

如果您使用 recreateForm:true 选项,则每次用户打开表单时都会重新创建编辑表单.因此,选择将填充"SalesDropDownGrid.php"(来自editoptions.dataUrl)返回的项目.

If you would use recreateForm: true option of the form editing then the edit form will be recreated every time when the user open the form. So the select will be filled with the items returned by "SalesDropDownGrid.php" (from editoptions.dataUrl).

如果您要在来自"SalesDropDownGrid.php"的响应中设置Cache-Control: max-age=0 HTTP标头,则结果将不会被缓存,并且选择内容将填充为推销员"的当前列表.如果您在PHP代码中设置HTTP标头时遇到问题,可以选择使用

If you would set Cache-Control: max-age=0 HTTP header in the response from "SalesDropDownGrid.php" the results will be not cached and the select will be filled with the current list of "Salesman". If you have some problems with the setting of HTTP headers in your PHP code you can use alternatively

ajaxSelectOptions: { cache: false }

请参见答案.

这篇关于JqG​​rid EditForm刷新选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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