Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:singe_searching [2011/06/19 09:34]
tony
wiki:singe_searching [2018/02/02 20:55] (current)
admin
Line 1: Line 1:
-~~ODT~~ 
 ====== Single field searching ====== ====== Single field searching ======
 Single field searching is a way to search data (at server) on one field at a time. When using this method we construct a modal form where the user can select a field and condition to apply the search. ​ Single field searching is a way to search data (at server) on one field at a time. When using this method we construct a modal form where the user can select a field and condition to apply the search. ​
 {{ :​wiki:​simplesearch2.png | Singe Field serching}} {{ :​wiki:​simplesearch2.png | Singe Field serching}}
 + 
 This method uses the url to post the search data and differ from the custom and toolbar search methods. The difference is that the posted search data is not in pair name:value. See below how data is posted. ​ This method uses the url to post the search data and differ from the custom and toolbar search methods. The difference is that the posted search data is not in pair name:value. See below how data is posted. ​
  
Line 16: Line 15:
 ... ...
 </​script>​ </​script>​
 +
 </​code>​ </​code>​
 or using the new API or using the new API
Line 74: Line 74:
 |closeAfterSearch|boolean| If set to true this closes the search dialog after the user apply a search - i.e. click on Find button|false| |closeAfterSearch|boolean| If set to true this closes the search dialog after the user apply a search - i.e. click on Find button|false|
 |closeAfterReset|boolean| If set to true this closes the search dialog after the user apply a reset - i.e. click on Reset button|false| |closeAfterReset|boolean| If set to true this closes the search dialog after the user apply a reset - i.e. click on Reset button|false|
-|drag|boolean|Enables or disables draging of the modal|false|+|drag|boolean|Enables or disables draging of the modal|true| 
 +|jqModal|boolean|If set to true uses jqModal plugin (if present) to creat the dialogs. If set to true and the plugin is not present jqGrid uses its internal function to create dialog|true|
 |resize|boolean|Enables or disables resizing of the modal|true| |resize|boolean|Enables or disables resizing of the modal|true|
 |modal|boolean|Is set to true the search dialog becomes modal|false| |modal|boolean|Is set to true the search dialog becomes modal|false|
 |width| integer|Defines the width os the search dialog| 450| |width| integer|Defines the width os the search dialog| 450|
 |height| mixed| Defines the height of the search dialog| auto| |height| mixed| Defines the height of the search dialog| auto|
 +|top| integer|the initial top position of modal dialog. The default value of 0 mean the top position from the upper left corner of the grid. When jqModal option is true (see below) and jqModal plugin is present any value different from 0 mean the top position from upper left corner of the window.|0|
 +|left| integer|the initial left position of modal dialog. The default value of 0 mean the left position from the upper left corner of the grid. When jqModal option is true (see below) and jqModal plugin is present any value different from 0 mean the left position from upper left corner of the window.|0|
 |caption|string|The caption of the modal|see lang file| |caption|string|The caption of the modal|see lang file|
 |showQuery| boolean| If set to true shows the query which is generated when the user defines the conditions for the search. Valid only in advanced search. Again with this a button near search button appear which allows the user to show or hide the query string interactively ​ | false| |showQuery| boolean| If set to true shows the query which is generated when the user defines the conditions for the search. Valid only in advanced search. Again with this a button near search button appear which allows the user to show or hide the query string interactively ​ | false|
 +|searchOnEnter| boolean|Determines whether search should be applied on pressing Enter key.| false|
 |Find|string|The text in the find button|see lang file| |Find|string|The text in the find button|see lang file|
 |multipleSearch|boolean|If set to true this activates the advanced searching|false| |multipleSearch|boolean|If set to true this activates the advanced searching|false|
-|multipleGroup|boolean|If set to true this activates the advanced searching with a possibilities to define a complex ​condfitions|false|+|multipleGroup|boolean|If set to true this activates the advanced searching with a possibilities to define a complex ​conditions ​|false|
 |odata|array|Translation strings that corresponds to the sopt options|see lang file| |odata|array|Translation strings that corresponds to the sopt options|see lang file|
 |onClose|function|If defined this event fires when the dialog is closed. Can return true or false. If the event return false the dialog will not be closed|null| |onClose|function|If defined this event fires when the dialog is closed. Can return true or false. If the event return false the dialog will not be closed|null|
-|afterRedraw| function| This function if defined is lunched every time the filter is redrawed - the filter is redrawed ​evey time when we add or delet rules or fields Tio this function we pass the search parameters as parameter | null|+|afterRedraw| function| This function if defined is lunched every time the filter is redrawed - the filter is redrawed ​every time when we add or delet rules or fields Tio this function we pass the search parameters as parameter | null|
 |onSearch|function|If defined this event fires when the search Button is clicked.|null| |onSearch|function|If defined this event fires when the search Button is clicked.|null|
 |onReset|function| If defined this function fire if reset button is activated |null| |onReset|function| If defined this function fire if reset button is activated |null|
-|closeOnEscape| boolean | Is this option is set to true the search ​dialogue is closed if the user press ESC key|+|closeOnEscape| boolean | If this option is set to true the search ​dialog will be closed if the user press ESC key|false|
 |onInitializeSearch|function|This event occurs only once when the modal is created|null| |onInitializeSearch|function|This event occurs only once when the modal is created|null|
 +|recreateForm| boolean | when set to true the form is recreated every time the search dialog is activated with the new options from colModel (if they are changed)|false|
 |showOnLoad|boolean| This option is valid only in navigator options. If set to true the dialog appear automatically when the grid is constructed for first time| false| |showOnLoad|boolean| This option is valid only in navigator options. If set to true the dialog appear automatically when the grid is constructed for first time| false|
 |errorcheck| boolean | if searchrules are defined this turn on of error checking. If there is a error in the input the filter is not posted to the server and a error message appear.|true| |errorcheck| boolean | if searchrules are defined this turn on of error checking. If there is a error in the input the filter is not posted to the server and a error message appear.|true|
Line 97: Line 102:
 |sFilter|string|Aplicable to advanced searching. See advanced [[:​wiki:​advanced_searching | searching]] |filters| |sFilter|string|Aplicable to advanced searching. See advanced [[:​wiki:​advanced_searching | searching]] |filters|
 |sOper|string|See //sopt// description|searchOper| |sOper|string|See //sopt// description|searchOper|
-|sopt|array|Use this option to set common search rules. If not set all the available options will be used. All available option are: ['​eq','​ne','​lt','​le','​gt','​ge','​bw','​bn','​in','​ni','​ew','​en','​cn','​nc'​] The corresponding texts are in language file and mean the following: ['​equal','​not equal',​ '​less',​ 'less or equal','​greater','​greater or equal',​ '​begins with','​does not begin with','​is in','​is not in','​ends with','​does not end with','​contains','​does not contain'​] Note that the elements in sopt array can be mixed in any order.| |+|sopt|array|Use this option to set common search rules. If not set all the available options will be used. All available option are: ['​eq','​ne','​lt','​le','​gt','​ge','​bw','​bn','​in','​ni','​ew','​en','​cn','​nc','​nu','​nn'] The corresponding texts are in language file and mean the following: ['​equal','​not equal',​ '​less',​ 'less or equal','​greater','​greater or equal',​ '​begins with','​does not begin with','​is in','​is not in','​ends with','​does not end with','​contains','​does not contain','​is null','​is not null'] Note that the elements in sopt array can be mixed in any order.| |
 |sValue|string|See //sopt// description|searchString| |sValue|string|See //sopt// description|searchString|
 |overlay|integer|If this option is set to 0 the overlay in grid is disabled and the user can interact with the grid while search dialog is active | 10 | |overlay|integer|If this option is set to 0 the overlay in grid is disabled and the user can interact with the grid while search dialog is active | 10 |
Line 104: Line 109:
 |tmplFilters|array of objects | if defined this should correspond to the tmplNames. See demo how to define template| null| |tmplFilters|array of objects | if defined this should correspond to the tmplNames. See demo how to define template| null|
 |tmplLabel| string| If a template is defined a select element appear between the Reset and Find buttons. This is a the text describing the select |Template:| |tmplLabel| string| If a template is defined a select element appear between the Reset and Find buttons. This is a the text describing the select |Template:|
 +|zIndex|integer|The starting z-index for the dialog. If you will see the dialog form under another elements or dialogs you should use the parameter with some value higher as default value 950. In the most cases it should be the value higher as 1000 - the default value of jQuery UI dialog.|950|
  
 As mentioned above posting search data differs from custom and toolbar searching. When the find button is clicked, jqGrid adds three parameters to the url (again with _search=true),​ in name=value pairs: As mentioned above posting search data differs from custom and toolbar searching. When the find button is clicked, jqGrid adds three parameters to the url (again with _search=true),​ in name=value pairs:
Line 116: Line 122:
  
 {{section>​search_config#​colmodel_options}} {{section>​search_config#​colmodel_options}}
 +{{section>​search_config#​colmodel_conventions}}

QR Code
QR Code wiki:singe_searching (generated for current page)