is there any Yii way to integrate phpGrid with Yii2.
I keep getting error class 'C_DataGrid' not found even after following all the instruction given here: https://phpgrid.com/documentation/
the reason I want to use this grid is an Advance search/filter like "<", ">=", "!=", "not null" on numbers "start/end with" or range on dates and "contains" on a string.
Related
I did a search on this topic and I am not that JSON familiar, so I thought I'd see if I can find the answer here to my question from the community.
I have a view from a list that I am formatting in SharePoint (SP) that creates some automated JSON. It simply colors the items based on if the value matches in the generated JSON code. I am trying to tweak it but having trouble getting the format to come up as a match.
I am trying to use just the one column called Display. It's a calculated field which concatenates a bunch of string text.
Here is what the generated section of code from SP I am trying to tweak looks like (this is not all of it):
{ "operator": "==",
"operands": [
"[$Display]",
"LOCATED"
]
}, =if(#isSelected == "true" etc...
So the formatting will happen if the data in field Display = LOCATED returning true and will apply the formatting. What I am trying to do, is get some sort of string contains or wild card matching.
The contents of the field Display in the SP list will contain something dynamic and possibly the word LOCATED somewhere in the text.
So ideally I'd like to tweak this code to return true for the formatting if the Display field content said something like "John Doe LOCATED New York" for example.
if anyone has any ideas how I could solve this that would be great. Also I was trying another field which is a choice field for exact matching but I couldn't get it to work either.
Thanks.
This issue has been resolved, by doing an exact field match instead of wildcarding.
I'm using Postman to test a GET on my SSRS database. The GET is "http://server/reports/api/v2.0/CatalogItems". This works and gives me lots of information. One of the values is "Type": which has values such a "Folder" and "Report". I would like to get only the Reports. I can get a specific report using "http://server/reports/api/v2.0/CatalogItems?$filter=Name eq 'ReportXYZ'". But if I use "?$filter=Type eq 'Report'" I get the error "The query specified in the URI is not valid. A binary operator with incompatible types was detected. Found operand types 'Model.CatalogItemType' and 'Edm.String' for operator kind 'Equal'."
Any ideas how to do this? Thanks!
FINALLY found the answer! "?$filter=Type eq Model.CatalogItemType'Report'". I don't know why this isn't documented better on the Swagger site or one of Microsoft's pages.
Type is a enum, not a string. So for any enum's this should work.
I am currently doing a project and I have a huge json list with schools in my country I would like to add one more field to each object, is there any website to do this, without typing it manually?
There are many ways you can achieve this.
First, I am assuming you are dealing with what is known as a json array which looks like this
[{name:"John", age:31, city:"New York"},
{name:"Jim", age:27, city:"London"},
{name:"Jeff", age:80, city:"Dublin"}]
You could simply use a program such as Notepad++ & do a search/replace Ctrl+h.
Find what: }
Replace with: , mynewfield: ""}
This method will replace all instances of an ending curly bracket (end of a json object) with a new field & value of your choice. So essentially, its just appending a new field for each object.
An alternative way that is also very useful when dealing with large data is with "regular expressions" (or regex expressions). The use case here for using a regex expression could be if you didn't want to add your new field to the end of each object but, somewhere in the middle (like before/after age).
In the case, you could use
Find what: (?<=,)(.*)(?=age) (or (?<=,)(.*)(?=city))
Replace with: mynewfield: "",
NOTE: For regex expressions you must have them enabled under the "Search Mode" after clicking control+h.
Is your sandbox (https://developers.google.com/drive/v2/reference/files/list) not working properly or am I doing this wrong?
Here's the parameters I'm putting in for q--
'[folderid]' in parents and name contains '[document name]'
^^ folderId and document name are of course replaced with actual things (no brackets) in my search.
Any idea what's going wrong?
Help is greatly appreciated. Thank you!
The problem with your query is the "name" keyword, not "and".
For some reason, in v2, the query textfield for Try It Yourself does not accept "name" keyword. It always returns error "The value of the parameter 'q' is invalid."
But, I noticed that if you changed 'name' with 'fullText', like:
'folderid' in parents and fullText contains 'Android'
then it works. The query is accepted.
However, this seems to have been fixed in Drive v3. In v3,"name" is accepted query keyword. Thus,
'folderid' in parents and name contains 'Android'
works like a charm.
How to use search and filter in the same query?
String url = "https://outlook.office.com/api/v2.0/me/messages?$filter=ReceivedDateTime ge 2016-02-22&$select=Subject,From,Body,ReceivedDateTime&$search=\"subject:(Chris Brown OR Michael Jackson)\"";
I need to find all mails with Subject having either "Chris Brown" or "Michael Jackson" and mail received date after 22nd Feb, 2016. Also it should have Subject, From, Body, ReceivedDateTime in the REST response.
Could anyone please help?
FYI - I am getting output if it has either filter or search. But when given together, I am getting a "Bad Request" error.
Right now this is not supported. From Use OData query parameters:
You cannot use $filter or $orderby in a search request.
So, the only way to do this is to perform a search via a query, and then filter on the client; or vice versa.
Update
In this particular case, since subject is filtrable and supposedly you only need an exact subject match (and not 'contains' for example), you can use something along the lines of:
https://outlook.office.com/api/v2.0/me/messages?$filter=(ReceivedDateTime ge 2016-02-22) and ((subject eq 'Chris Brown') or (subject eq 'Michael Jackson'))
To answer the original question: yes it is possible. #roman-pletnev correctly pointed out that you cannot use $filter or $orderby in a $search request. However, you can achieve the desired result using just $search.
$search="
(subject:(Chris Brown) OR subject:(Michael Jackson))
AND (received:02/22/2016..10/21/2016)
"
Note that extra linebreaks have been included for readability.
Also note that the received parameter seems to only work with a single date, or a specific range. I.e. you cannot request "everything after 02/22/2016". Instead you have to input today's date (or a future date?) as the end of the range.
received:<date>
received:02/22/2016
received:<start>..<end>
received:02/22/2016..10/21/2016
I'm not 100% sure about the date format. I don't know if it's determined by your account's locale or if it's always MM/DD/YYYY.
Other variations seem to work as well. However, the documentation for this is very bad and most of the documented syntax for "received" doesn't seem to work. I've filed a support ticket with Microsoft regarding this.
Some other documented syntax does work, for example received:today
Some documented syntax does not work, for example received:October
References:
https://support.office.com/en-us/article/Learn-to-narrow-your-search-criteria-for-better-searches-in-Outlook-d824d1e9-a255-4c8a-8553-276fb895a8da
https://support.office.com/en-us/article/Search-Mail-and-People-in-Outlook-on-the-web-for-business-88108edf-028e-4306-b87e-7400bbb40aa7
https://msonlinehelpdesk.zendesk.com/hc/en-us/articles/200561417-Learn-how-to-fine-tune-email-search-results-in-Outlook-and-Outlook-Web-App-OWA-