List Widget API
This widget can be used to create a list of either your open questions, KB questions, or FAQ questions. You can specify how many results are returned per page, as well as other parameters.
The first step is to make sure that you are including jQuery on your page, and that you are also calling the Widget API function, as explained on this page.
Wherever the API needs to display, simply create a unique ID for an element to populate with the Search widget, and then call the refTrackerSearch plugin:
refTrackerSearch plugin
123456789101112131415161718 | // id can be anything - as long as it's also referenced in the below script <div id= "RefTrackerWidget" ></div> ... // Somewhere further down - near the bottom of the page, but before the </body> element <script type= "text/javascript" > ( function () { // Make sure that you specify the same id here as above! $( "#RefTrackerWidget" ).refTrackerList(); })(); </script> |
The RefTracker API has a specific set of limitations associated with it – starting page number, database selection, returned results, etc. This plugin adheres to those limitations in it’s calls unless the calls are overidden.
Overwriting Default Values
This plugin allows for optionally overriding the call to the API. This allows for any number of values to be passed, either optionally, or in your javascript call. The following default values can be overriden:
Key | Description | Example |
address | get all questions where client address fields contain search term | “address”:”123 example” |
category | get all questions assciated with the specified categories Id(s) | “category”:”10|3″ |
clientLocation | get all questions where client location is specified id | “clientLocation”:”40″ |
clientName | get all questions where client name fields contain search term | “clientName”:”alex” |
db | Specifies database to Search: 1=Open Questions 2=KB 3=FAQ | “db”:”1″ |
dateclass | Specifies receipt date range relative to now: today=1000 yesterday=1100 thisweek=2000 lastweek=2100 thismonth=3000 lastmonth = 3100 thisquarter=4000 lastquarter=4100 thisyear=6000 lastyear=6100 | “dateclass”:”3000″ |
get all questions where client email fields contain search term | “email”:”info” | |
phone | get all questions where client phone fields contain search term | “phone”:”123″ |
questionNo | get all questions where question number matches specified parms. Beginning question Number part question number with wild card beginning and end question no | “questionNo”,”PROB1234″ “questionNo”,”PROB12*” “questionNo”,”PROB1234|PROB3333″ |
requestForm | get all questions with specified request form ID(s) | “requestForm”:”7|3″ |
requestGroup | get all questions with specified request group ID(s) | “requestGroup”:”5|1″ |
requestType | get all questions with specified request type ID(s) | “requestType”:”114|120″ |
staff | get all question for specified staff ID | “staff”:”25″ |
staffLocation | get all questions where staff location is specified id | “staffLocation”:”1″ |
status | get all questions for specified status ID | “status”:”010″ |
statusGroup | get all questions for specified statusGroup ID(s) | “statusGroup”:”100|600″ |
scopeList | question = 100 answer = 200 client = 300 bib_ill = 400 Note = 500 attachment = 600 | “scopeList”:”100|200″ |
text | This is set to empty in the base version of this API | “text”:”” |
columnList | specifies list of columns to be returned These can be any data dictionary item, including custom ones | “columnList”:”question_no|question_text|question_answer” |
expansweratts | Include answer attachments | “expansweratts”:”1″ |
expcategories | Include categories string | “expcategories”:”1″ |
expjournaltotals | Include journal total fields | “expjournaltotals”:”1″ |
expquestionatts | Include question attachments | “expquestionatts”:”1″ |
expresources | Include resources string | “expresources”:”1″ |
expnotes | Include notes | “expnotes”:”1” |
pageNumber | Which page to retrieve | “pagenumber”:”1″ |
pageSize | Number of records per page | “pagesize”:”10″ |
sortBy | ResponseDate = 1 ReceivedDate = 2 ClosedDate = 3 FAQDate = 8 KBDate = 9 questionNo = 50 | “sortby”:”50″ |
sortOrder | Order of sort ASC DESC | “sortorder”:”ASC” |
To override any of these values, pass along a defaulted parameter in your call to the RefTracker Search function:Updating API Default values
12345678910 | $( "#RefTrackerWidget" ).refTrackerList({ db:1, columnList: "client_email|client_department|question_text" , pagesize:25, scopelist:100, requestGroup:5 }); // the above jQuery call will override the default values with the same corresponding key names |
One quick note about the columnList field: not only does it determine which fields get returned, it also determines the order of the fields returned. So, for example, if you’d returned the above, each record returned would include the client_email field, then the client_department field, and then the question_text field, assuming there was data to return in each record. If you instead needed the question_text field to display first in the record’s listing, include it first in your columnList parameter.
Displaying Search Results
As this is a simplified approach in providing a working with the RefTracker search API, it does have it’s limitations. Each returned record is currently being stored in a <div></div> HTML element. For styling / javascript purposes, you can access an individual record based on the record number that’s been returned:

Additionally, you’ll be able to easily style your returned layout, because each element returned will be in a <div></div> HTML element with the class name equal to the data dictionary name. This way, you can have all of the emails, questions, answers, dates – whatever data you return, can be accessed with the same value.
If you have any questions, please don’t hesitate to reach out to your RefTracker support staff member.