OR condition in JQgrid's toolbar search - jqgrid

I'm very new to JQgrid. I have a requirement which i'm not able to solve.
I'm using toolbar filer with searchonenter as true and data is local.
The rquirement is if a user types 'apple banana' in the filter textbox of a column then the filter should fetch the rows with text as apple or banana.
Can anyone please give an idea on how to implement this?
Thanks,
suneel

I posted before the answer on the same question.
The problem is that not accepted and not voted answers will be practically never found by searching. It's the problem if one answers on the questions of persons having minimal reputation points. I strictly recommend all to read carefully the How do I ask questions here? in the FAQ.
I recommend you additionally to modify the title of your question so that one could understand more from the reading of the title.
Best wishes!

When you call the function to create the filtertoolbar, you have an option 'groupOp' which default is AND, you can change to OR as follow:
$('#jQGrid').jqGrid('filterToolbar', { groupOp: 'OR' });
Hope it make sense for you.

Related

Combining 'Isblank Status' with an imbedded 'IF' statement

I am trying to combine the following two statements together and struggling to combine them.
The first one is checking the outcome of survey questions where the outcome is either "Pass" or "Fail".
The second one is if the overall questionnaire column is blank (the survey has not been filled in yet), I would like the cell to be populated with "" (blank, not show anything. Currently I am seeing "Fail")
1st Formulae:
=IF((AND(H18="No",I18="Yes",J18="No",K18="Yes",L18="2 Metres",M18="Yes",N18="Yes",O18="Yes",P18="Yes",Q18="Yes")),"Pass","Fail")
2nd Formulae:
=if(and(isblank(H2:Q2))," ",)
Any help would be appreciated
Regards
Caroline
I think this combination works:
=IF((AND(H18="No",I18="Yes",J18="No",K18="Yes",L18="2 Metres",M18="Yes",N18="Yes",O18="Yes",P18="Yes",Q18="Yes")),"Pass",if(COUNTA(H18:Q18),"Fail","blank"))
If they enter something, but not correctly, they "Fail", if they entered everything correctly, they "Pass", and if it is blank, this shows "blank".
You can change "blank" to "" (ie. empty quotes) if you don't want anything shown for a blank record.
Here is a sample sheet:
https://docs.google.com/spreadsheets/d/1rGCeNF_Eje7UrpM3PK9YTk_3ZKBo1qOAVEVoRVmqyRs/edit?usp=sharing
Please check back here and flag if this answers your question, to help others in the future. If not, please clarify what's missing.
Note that this may not be the most efficient way of handling your survey responses, since the correct answers are all 'hard coded' into the formula. If it makes sense for you, it might be better to have the correct answers stored as a list - one answer per question - so that you could add or change questions in the future, without having to change the formula. If that's what you'd like, share a COPY of your sheet, with any sensitive data removed, and set the SHARE options to allow anyone to edit.

Salesforce Rule: if one field populated, then prevent population of the second field

I would like to ask for a help with Salesforce. The official Salesforce communities website encounters a login bug, so I thought I would ask here, as always I got the positive reception here.
I would like to create the rule which will make unable to click the Potential Duplicate field if Left Organization is already marked as True. Could anyone help me to create such rule?
Create a validation rule that checks in the formula:
AND (
NOT( ISBLANK(potential_duplicate_field__c),
Left_Organization__c
)
assuming potential_duplicate_field__c is a text or some such and Left_Organization__c is a check box.
Ok. I have found the solution meanwhile. If anyone looks for the answer for similar case this code will help
AND(Left_Organization__c=TRUE,Potential_Duplicate__c=TRUE)

What does the NSStringDrawingUsesDeviceMetrics flag mean and how do we use it?

This question is in relation to my comment at How do we measure visible bounds of text in Cocoa?.
Here are a couple of links explaining the meaning of the flag.
Apple docs
Apple lists answer to a similar question
From the above, I guess the option NSStringDrawingUsesDeviceMetrics is given for obtaining the visible bounds of text but it doesn't seem to do that. Among the inputs (font and string) I tried giving to the method boundingRectWithSize:options:attributes: none of the outputs were different when the flag was given compared to when the flag was not given. Am I doing something wrong or is it a bug in Cocoa?
Thank you
Google this monkey patch
NS(Attributed)String+Geometrics
It solves the problem fairly reliably.

jqGrid recreateForm parameter

I would like to know where is the correct ubication of the following sentence:
jQuery.extend(jQuery.jgrid.edit, {recreateForm: true}).
I found here that setting it, you can solve problems with edition of rows, when you are using custom edittype columns, in respect of these type of fields don't refresh between successive editing records. But I proved it without positive results.
I'm using form editing.
Thanks for your helping.
jQuery.extend(jQuery.jgrid.edit, {recreateForm: true});
is the correct code to change default value of recreateForm to true. You can find in my answer in the forum of http://www.trirand.com other different variation to set recreateForm to true.
If this will not help you, you have probably another problem in your code. You can append your question with the code which can be used to reproduce your problem. I or somebody else could try to solve your problem.

Searching a datastore for related topics by keyword

For example, how does StackOverflow decide other questions are similar?
When I typed in the question above and then tabbed to this memo control I saw a list of existing questions which might be the same as the one I am asking.
What technique is used to find similar questions?
I got an email from team#stackoverflow.com on Mar 20 that mentions how it works:
the "ask a question" search is
exclusively on title and will not
match anything in the body. It is a
mystery to me why people think it's
better.
The last sentence refers to the search bar, which I've found is less useful when I'm trying to find a specific question I've already seen.
I think it's plain old word matching. However, I might add that this feature does not work as well as I would like it to. It's much better to do google search with site:stackoverflow.com prefix than to rely on SO to provide the relevant suggestions.
Poorly -- using MS SQL Full Text Search, I believe. You'll have better luck using Lucene, IMO. For more background on the topic see the Wikipedia article on Lucene or the general topic of information retrieval.
The matching program would store an index of all questions. When you ask a question, all keywords in your question are matched against the index. This is similar to Google Search. Lucene open source search can be (and with high probability has been) used for this. Since the results are not quite accurate, I presume they index just the headlines of the questions, as an approximation.
The other related keyword is collaborative filtering, the algorithm popularized by Amazon to recommend products based on behavior of other similar customers. In the current case, an alternative algorithm based on collaborative filtering is: keywords are extracted from the question, then tags associated (in the history) with the keywords are found. Questions which have those tags are returned. Well, experiments are needed to see whether it works well at all.

Resources