I am using jqgrid advanced search(Client side search). Is there a way how I can exclude few rows from searching. That is I want to display those rows irrespective of search criteria. I know that we can exclude column by giving search : false in the colmodel option. Please help.
Asked
Active
Viewed 1,775 times
1 Answers
0
I am not sure why you need such behavior. Nevertheless if you know which rows which you want exclude it means that you can formulate an additional searching filter which exclude unneeded rows. You can use onSearch callback of searching options to modify the filters
property of postData
before the filtering will be started.
See here an example of modification. You can add additional group to the filter (see the documentation) to implement filtering of the rows which you need to exclude.
-
Thanks Oleg. Perfect solution which I was looking for. My form has frozen rows which need to be displayed all the time. So this behaviuour is needed. – user1986736 Jan 18 '13 at 05:02
-
I am trying to use multiplegroup: true in my page. My sample query looks like this : ((A = 11) OR B = 2). Although I have record for this condition, no data is returned. I could not figure out the problem. Please help. However everything works fine if I dont use multiplegroup. What is wrong. – user1986736 Jan 18 '13 at 09:13
-
@user1986736: You should describe the problem in new question. You should post the code which you use and describe the test case which should one follow to reproduce the problem. – Oleg Jan 18 '13 at 09:17
-
can you give me an example of how I can exclude the first row irrespective of search option? – user1986736 Jan 24 '13 at 09:31
-
@user1986736: Searching filters are based not on the *position* of the row ("the first row"). It's based on the *data*. So you should specify the corresponding role based on the data which are in the first row only. I suppose that the origin of the problem is the way **how** you added the first row. It you added it as all other data and it contains not the real data then it's your error. If you fix the *origin* of your problem then the problem which you try to solve now will not exist at all. – Oleg Jan 24 '13 at 09:43
-
I mean to exclude a row with a particular Id. – user1986736 Jan 24 '13 at 09:44
-
I am using client side search. – user1986736 Jan 24 '13 at 09:46
-
@user1986736: I can repeat that it's the wrong way. You question is like the question how to exclude the row based on the color of the eyes of the user. jqGrid use for filtering of data only the data itself and can't access other information directly. You have to forward the information in any way to jqGrid. Only after that you will be able to make filtering based on the information. We spend many time in discussion in common words. It will be much more productive if you describe detailed what you want to do and post your current code. After that I will be able to help you to solve the problem – Oleg Jan 24 '13 at 09:50