在jqgrid高级搜索中添加新条件后,下拉菜单中将清除所选值 [英] the selected value was cleared in dropdown after add new criteria in jqgrid advanced searching

查看:144
本文介绍了在jqgrid高级搜索中添加新条件后,下拉菜单中将清除所选值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jqgrid高级搜索中,添加新条件后,下拉列表中选择的值被清除.

在下面的细节中供您参考.

1)在jqgrid列模型中

{name:'instrumentType', 
 index:'instrumentType',
 searchoptions:{
                dataInit:instrumentTypeDataInit,
                sopt: ['eq','ne','nu','nn','in','ni']},    
 align:"left", 
 stype:'select'},

2)instrumentTypeDataInit的javascript函数

instrumentTypeDataInit=function(el){
    var categoryInstrumentTypeOptions = "${categoryInstrumentTypeOptions}";  
    $(el).append(categoryInstrumentTypeOptions);
  }

3)当添加标准"Instrument Type",并选择"OPTION"时,效果很好.

4)添加其他条件时,将清除所选的值.

有人知道为什么吗?那有什么解决方案?非常感谢.

我以错误的方式使用了dataInit函数,改用searchOptions.value,问题已解决,您可以参考另一篇文章:解决方案

我以错误的方式使用了dataInit函数,而是使用searchOptions.value,问题已解决,您可以参考

2) javascripts function for instrumentTypeDataInit

instrumentTypeDataInit=function(el){
    var categoryInstrumentTypeOptions = "${categoryInstrumentTypeOptions}";  
    $(el).append(categoryInstrumentTypeOptions);
  }

3) when add criteria "Instrument Type", and select "OPTION", it goes well.

4) when add another criteria, the value selected is cleared.

Does anyone know why it is? and what's the solution? thanks a lot.

EDIT:

i've used the dataInit function in the wrong way, used searchOptions.value instead, the issue has been resolved, you can refer another post:best way to dynamically populate dropdown options in jqgrid advanced searching

解决方案

i've used the dataInit function in the wrong way, used searchOptions.value instead, the issue has been resolved, you can refer another post, Oleg has given an answer:

这篇关于在jqgrid高级搜索中添加新条件后,下拉菜单中将清除所选值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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