Page tree
Contents

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.ands.org.au/apps/assets/grant_widget/css/grant_widget_v2.js"></script>
<link rel="stylesheet" type="text/css" href="https://researchdata.ands.org.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

JSFiddle

 

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)

JSFiddle

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.

JSFiddle

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:

PropertyDescriptionDefault
search_endpointJSONP search API for Grantshttps://researchdata.ands.org.au/api/v2.0/registry.jsonp/activities/grant?
lookup_endpointJSONP API for Grants Lookup servicehttps://researchdata.ands.org.au/api/v2.0/registry.jsonp/activities/grant?
pre_lookupAutomatically Do a lookup on the current value of the input fieldfalse
searchDisplay Search Button, enable searching functionalitytrue
pre_open_searchOpen Search Box by defaultfalse
search_textText to display on the open search box button<i class="icon-search"></i> Search
search_classCSS class to apply on the open search box buttongrant_search btn btn-small
tooltipfalse,Boolean to have hover tool tip or not
lookupDisplay the Lookup button, enable Lookup functionalitytrue
lookup_textText for the lookup buttonLook up
lookup_classLookup button CSS classgrant_lookup btn btn-small
before_html:Text to display before the input field<span class="grant_before_html">grant title </span>
wrap_htmlThe wrapping HTML to cover the input fields<div class="grant_wrapper"></div>
result_success_classCSS class for the div displaying successful lookupgrant_success_div
result_error_classCSS class for the div displaying error lookupgrant_error_div
search_div_classCSS class for the searching divgrant_search_div
nohits_msgMessage to display when no result or an error returns<p>No matches found <p>
query_textText displaying before the search querySearch Query:
search_text_btnText display for the search buttonSearch
close_search_text_btnText display for the closing search div button[x]
lookup_error_handleroverwrite function for error lookupfunction(xhr, message)false
lookup_success_handleroverwrite function when a successful lookup returnsfunction(data, obj, settings)false
lookup_success_hooka function hook after a successful lookup returnsfunction()false
auto_close_searchboolean, To automatically close the search box after a value is selectedfalse
funder_listsboolean, To allow for user provided lists of funders to search againstfalse
fundersjson string providing list of funders in the funding_list element eg. funders: ‘{“funder_list”:[“Australian Research Council”,”National Health and Medical Research Council”]}’ 
search_fieldsjson string providing list of searchable fields of the api ‘search_fields: '{"search_fields":["title","researcher","principalInvestigator","institution","description","identifier"]}'