【问题标题】:External filter dropdown for jqgridjqgrid 的外部过滤器下拉列表
【发布时间】:2015-11-29 11:14:59
【问题描述】:

我有一个 JQGrid,其中包含 3 列 1) ID、2) 国家/地区、3 描述

id| country | Description  
1 | France  | this is just a test    
2 | China   | this is just a test  
3 | Russia  | this is just a test  
4 | France  | this is just a test   
5 | France  | this is just a test

现在需要一个包含唯一国家/地区名称的外部选择下拉列表

与上述一样,下拉值将是 法国 中国 俄罗斯

1) 是否可以通过 Jquery 或其他没有 DB Hit 的方式来填充下拉列表? 2) 这很简单,但是在选择网格时需要过滤所选国家/地区

选择下拉菜单在页面外部,而不是在 jqgrid 内部

【问题讨论】:

    标签: javascript jquery html jqgrid


    【解决方案1】:

    您使用哪个datatype?您使用哪个版本的 jqGrid 和 fork(free jqGridGuriddo jqGrid JS 或一些旧的 jqGrid 版本

    一般而言,您可以按照the answer(修改the old one)中描述的想法在列中生成唯一值并在select 或autocomplete 中使用。旧答案使用 the filter toolbar 的内部选择和输入,但您可以以相同的方式使用外部元素。

    One more demo from the answer 使用select2 控制,我个人很喜欢。它具有选择和自动完成的优点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多