Grant ID Lookup Widget
The Grant ID Lookup Widget allows you to verify a research grant ID against the grant information supplied by research funders to ARDC, or alternatively to search for a grant using keywords in the following fields – Title, Researcher, Principal Investigator, Managing Institution, Description and Identifier.
This widget is powered by the Research Activities API and requires jQuery to function.
Grant Searches
By default almost all the searches carried out on the search fields are disjunctive except for the Principal Investigator field which is always conjunctive.
The Boolean operator 'AND' can be used on all disjunctive field searches to narrow down the results e.g. 'red AND sea'. However, when used with the Principal Investigator field the 'AND' operator will be interpreted as a search term. This disjunctive and conjunctive inconsistency in the search fields can lead to confusing search results. All fields will be made disjunctive in a future release.
Usage
Put the following code snippet into your HTML document between the <head></head>
tags.
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js'></script>
<script type="text/javascript" src="https://researchdata.edu.au/apps/assets/grant_widget/css/grant_widget_v2.js"></script>
<link rel="stylesheet" type="text/css" href="https://researchdata.edu.au/apps/assets/grant_widget/css/grant_widget_v2.css" />
And you’re done! Just 3 lines of code! Any input fields on your page which have the class grant_widget
will be transformed into a fully-functional Grant id lookup tool.
Demo
Default Settings
This example shows how to embed a Researcher Lookup tool into your webpage.
- if you don’t know your Grant id, click Search to search for your Grant id profile
- if you already know your Grant id, put it into the text field and click Lookup instead
Custom Settings
Example 1
In this example, we initialise the widget using some custom settings:
- the labels on the page have been changed (see the
JS
tab) - automatically display the search box when the widget loads
- a default value for the Grant id has been set in the
HTML
tab (and this is displayed when the page loads)
Example 2
Another example where we initialise the widget using custom settings (see the JS
tab)
- Enable tooltip of full information on mouseover of the results list
- Overwrite default funder list to search against
- Overwrite default search fields to search against
Note: This tooltip feature requires the qtip jquery plugin to be installed to display correctly.
Configuration
You can initialise the plugin by simply adding a class of grant_widget
to an input element (demo):
<input type="text" class="grant_widget">
You can also manually trigger the plugin with Javascript:
$('input').grant_widget();
In this mode, you can pass the grant_wiget()
function any of the following configuration parameters:
Property | Description | Default |
search_endpoint | JSONP search API for Grants | https://researchdata.edu.au/api/v2.0/registry.jsonp/activities/grant? |
lookup_endpoint | JSONP API for Grants Lookup service | https://researchdata.edu.au/api/v2.0/registry.jsonp/activities/grant? |
pre_lookup | Automatically Do a lookup on the current value of the input field | false |
search | Display Search Button, enable searching functionality | true |
pre_open_search | Open Search Box by default | false |
search_text | Text to display on the open search box button | <i class="icon-search"></i> Search |
search_class | CSS class to apply on the open search box button | grant_search btn btn-small |
tooltip | false, | Boolean to have hover tool tip or not |
lookup | Display the Lookup button, enable Lookup functionality | true |
lookup_text | Text for the lookup button | Look up |
lookup_class | Lookup button CSS class | grant_lookup btn btn-small |
before_html: | Text to display before the input field | <span class="grant_before_html">grant title </span> |
wrap_html | The wrapping HTML to cover the input fields | <div class="grant_wrapper"></div> |
result_success_class | CSS class for the div displaying successful lookup | grant_success_div |
result_error_class | CSS class for the div displaying error lookup | grant_error_div |
search_div_class | CSS class for the searching div | grant_search_div |
nohits_msg | Message to display when no result or an error returns | <p>No matches found <p> |
query_text | Text displaying before the search query | Search Query: |
search_text_btn | Text display for the search button | Search |
close_search_text_btn | Text display for the closing search div button | [x] |
lookup_error_handler | overwrite function for error lookupfunction(xhr, message) | false |
lookup_success_handler | overwrite function when a successful lookup returnsfunction(data, obj, settings) | false |
lookup_success_hook | a function hook after a successful lookup returnsfunction() | false |
auto_close_search | boolean, To automatically close the search box after a value is selected | false |
funder_lists | boolean, To allow for user provided lists of funders to search against | false |
funders | json string providing list of funders in the funding_list element eg. funders: ‘{“funder_list”:[“Australian Research Council”,”National Health and Medical Research Council”]}’ | |
search_fields | json string providing list of searchable fields of the api ‘search_fields: '{"search_fields":["title","researcher","principalInvestigator","institution","description","identifier"]}' |