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

后端 未结 2 1050
温柔的废话
温柔的废话 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:33

    You are right, it seems impossible to use any escape character to place ':' inside of value of searchoptions if you define it like a string:

    searchoptions:{value:"1:'Level: 1'"}
    

    There is another form of setting of value of searchoptions - object form, which is also described under http://www.trirand.com/jqgridwiki/doku.php?id=wiki:search_config#colmodel_options. For example you can use following syntax

    searchoptions:{value:{'1:': 'Level: 1;', ':2:;': 'Level: 2;'}}
    

    It defines a select with the texts "Level: 1;" and "Level: 2;" displayed and the corresponding values "1:" and ":2:;". It works.

提交回复
热议问题