Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jqgrid:更改select的值_Java_Javascript_Jsp_Servlets_Jqgrid - Fatal编程技术网

Java jqgrid:更改select的值

Java jqgrid:更改select的值,java,javascript,jsp,servlets,jqgrid,Java,Javascript,Jsp,Servlets,Jqgrid,我正在使用JSP和Servlet(IDE:Eclipse,数据库:Oracle10)开发一个web应用程序。我正在使用jqGrid以表格格式显示记录 代码片段: {name:'CITY',index:'CITY', width:70,editable:true,edittype:"select",editoptions: {dataUrl: 'ProfileServ?action=comboCity', dataEvents: [{ type: 'change', fn: function(e

我正在使用JSP和Servlet(IDE:Eclipse,数据库:Oracle10)开发一个web应用程序。我正在使用
jqGrid
以表格格式显示记录

代码片段:

{name:'CITY',index:'CITY', width:70,editable:true,edittype:"select",editoptions: {dataUrl: 'ProfileServ?action=comboCity', dataEvents: [{  type: 'change', fn: function(e) {alert(this.value);city= this.value;}}],}}, 
{name:'PIN',index:'PIN', width:200,sortable:false,editable:true, edittype:"select",editoptions: {dataUrl: 'ProfileServ?action=comboPin'}},
我想根据
城市
中选择的值更改
PIN
的值。我使用了
dataEvents
type:'change'
来获取
CITY
的选定值。我正在成功获取所选的
城市值


我的问题是,当
城市
的值更改时,我应该如何更新
PIN
的值?

不幸的是,没有简单的方法来实现依赖选择。您必须手动更新
更改
回调内部的依赖选择的整个
(在您的情况下更新PIN选择)。我唯一能建议您的是检查来自的代码。这并不完全是您所需要的,因为它不使用
dataUrl
,但它显示了应该做什么。

+1为了回答(再次感谢),我在问这个问题之前阅读了您关于这个问题的大部分答案,并且我已经看过您的演示,但在提出这个问题之前,我认为在
jqgrid
中可能有一种方法可以完成这个任务。现在,我想我必须根据您的
演示和
答案更改代码。