We are using jqGrid searching.. how can you determine if a user has clicked Search, Reset, or has closed the search window?
There is an onClose event but it doesn’t seem to have any parameters that indicate the action.
??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer on your question is depend on how you want to use the information. If you want that your callback function will be called you can use beforeShowSearch together with
onClose:You should take in consideration, that your
onSearchandonResetfunctions will be called after the main event handler, so the request to search or the request to reset is already sent. If you need to have the information before the search or reset the usage ofbeforeRequestrequest seems me very good. If you need to have search rules you can use$("#list").jqGrid('getGridParam','postData')or just$("#list")[0].p.postData. ThepostDatahassearchField,searchOperandsearchString(in case of Single Searching) orfilters(in case of Advanced Searching) set. In case of “Reset” the parameters are empty: “”.