helpers/jrh_grid

Collection of helper functions for creating general purpose html grids of data

Source:
Author:

Methods

(private, inner) calcHeaderKeysNicely(gridSchema)

Source:

Get keys (columnns) for the header, adding our special ones for checkbox column and actions icons column

Parameters:
Name Type Description
gridSchema object
Returns:

raw html string

(async, inner) jrGridList(req, listHelperData)

Source:

Builds a grid table/list and form inputs for working with it

Parameters:
Name Type Description
req object

express request object

listHelperData obj

data to put in the grid; from model_base_mongoose?

Returns:

raw html string

(async, private, inner) jrGridListBulkActions(req, listHelperData, queryUrlData)

Source:

Builds html for a with all checked drop down box and button

Parameters:
Name Type Description
req object
listHelperData object
queryUrlData object

(private, inner) jrGridListPager(queryUrlData)

Source:

Builds html for implementing a pager area for the grid

Parameters:
Name Type Description
queryUrlData object
Returns:

raw html string

(private, inner) jrGridListPagerItem(label, pageIndex, flagLink, flagActive, queryUrlData)

Source:

Builds a single pager item.

Parameters:
Name Type Description
label string
pageIndex int

current page

flagLink boolean

whether pager item should be a working link

flagActive boolean

whether this pager item represents current page

queryUrlData object
Returns:

raw html string

(private, inner) jrGridListPagerItemPerPage(label, newPageSize, currentPageSize, flagLink, queryUrlData)

Source:

Helper function that creates the per-page dropdown option select

Parameters:
Name Type Description
label string
newPageSize int

the new page size that this item selects

currentPageSize int

the current page size of the currently viewed page

flagLink boolean

whether to link it

queryUrlData object
Returns:

raw html string

(inner) jrGridListShowHiddenOptions(req, listHelperData, queryUrlData)

Source:

Add some hidden optinon to the grid form

Parameters:
Name Type Description
req *
listHelperData *
queryUrlData *
Returns:

html to add to the input form

(async, private, inner) jrGridListTable(req, listHelperData, queryUrlData)

Source:

Build the html that represents the main area of the grid table

Parameters:
Name Type Description
req object
listHelperData object
queryUrlData object
Returns:

raw html string

(async, private, inner) jrGridListTableData(req, listHelperData, queryUrlData)

Source:

Builds the core internal html table data

Parameters:
Name Type Description
req object
listHelperData object
queryUrlData object
Returns:

raw html string

(private, inner) jrGridListTableHeader(listHelperData, queryUrlData)

Source:

Generates the header for a table with sortable columns, and filters

Parameters:
Name Type Description
listHelperData object
queryUrlData object
Returns:

raw html string

(private, inner) jrGridListTableHeaderSortDir(key, queryUrlData)

Source:

Returns the sort direction of a column key, based on previously parsed data

Parameters:
Name Type Description
key *
queryUrlData *
Returns:

string sort direction (asc|desc|null)