JQgrid - escape ':' in searchoptions (value part)

后端 未结 2 1028
温柔的废话
温柔的废话 2021-01-05 23:55

How to set the values for filter is explained here link text. I have two requirements.
1. the default value needs to be empty. I expect, if defaultValue is not set, the

2条回答
  •  时光说笑
    2021-01-06 00:14

    I had the same issue and the only option was to use searchoptions object. However, I had to programmatically build the list so I couldn't use define the objects.

    Therefore, I decided to use build the list as an JSON string and then parse it, as shown below:

      searchoptions: {
        value: $.parseJSON("{" + searchSelectFormat.join(",") + "}"),
        sopt: ['eq']
      }

    where searchSelectFormat is in the format of

    '"' + data + '":"' + data + '"';

    '"' + item+ '":"' + item+ '"'

提交回复
热议问题