q4.ownership
The Ownership widget is used to display data elements related to institutions & funds *Latest Version Update: 1.0.4
- Remove apiUrl and replace with studioApi - Reformat date reported as per API changes
Latest Version Update: 1.0.3
- Fixed pagination display being hardcoded - Added first page record option (firstRecordSelector) - Added last page record option (lastRecordSelector) - Fix pagination display not resetting when tab or dropdown is clicked - Fix next button not disabled when there's only one page
Latest Version Update: 1.0.2
- Updated Documentation - Added option to modify table headers. - Removed default apiUrl pointing to Dev - Removed ticker default - Fixed typos - Added appropriate console errors when API call fails - Added new callback function beforeShowTable
- Script link
- q4.ownership.1.0.5.min.js
- Source file
- q4.ownership.js, line 2
- Requires
Examples
<script type="text/javascript">
$('.ownership-widget').ownership()
</script>
Options
- studioApi string
-
URL for the Studio API,
- Example
'fb.studio.q4api.com'
- ticker string
-
The ticker you wish to load, please note this values must exist as part of the indices
- Example
'xnas.fb'
- summarySelector string
-
A selector where the summary table will be rendered
- Default value
.irwInstitutionalOwnershipDivTable
- totalTabsSelector string
-
A selector where the tabs will be rendered
- Default value
.irwInstitutionalOwnTabs
- totalDropdownSelector string
-
A dropdown replacement for the tabs while on tablet
- Default value
.irwInstitutionalOwnershipResponsiveTabs
- detailsSelector string
-
A selector where the details will be rendered
- Default value
.irwInstitutionalOwnContent
- ownershipTypeSelector string
-
A selector for the ownership type dropdown
- Default value
.irwInstitutionalOwnSelect
- activityTypeSelector string
-
Text to describe which tab is selected
- Default value
.InstitutionalOwnershipView
- paginationSelector string
-
A selector where the pagination will be added
- Default value
.irwInstitutionalOwnPagination
- totalCountSelector string
-
A selector which will be updated to the total number of items
- Default value
#recordCount
- firstRecordSelector string
-
A selector which will be updated to the first index of the current page
- Default value
#pageFirstRecord
- lastRecordSelector string
-
A selector which will be updated to the last index of the current page
- Default value
#pageLastRecord
- itemsPerPage number
-
The number of items to render per page
- Default value
20
- names object
-
A mapping object for all friendly names
names: { sharesOut: 'Shares Outstanding', shortInterest: 'Short Interest Shares', floatPct: 'Float (%)', instOwnershipPct: 'Institutional Ownership (%)', fundOwnershipPct: 'Mutual Fund Ownership (%)', insiderOwnershipPct: 'Insider Ownership (%)', topInstHoldersPct: 'Top 10 Instn Holders (%)', all: 'Total Positions', new: 'New Positions', increased: 'Increased Positions', decreased: 'Decreased Positions', soldout: 'Soldout Positions', netchange: 'Net Change' }
- headers function
-
A mapping object for the table headers. 'type' parameter is taken from the options under 'ownershipTypeSelector' option.
headers: function (type) { return [{ label: type === 'institution' ? 'Company' : 'Fund', fieldName: 'ownerName', cls: 'Tbl-th-FirstCol text-primary InstitOwnSorting', }, { label: 'Shares', fieldName: 'sharesHeld', cls: 'text-center text-primary InstitOwnSorting', sortBy: true }, { label: '% Out', fieldName: 'outprcnt', cls: 'text-center text-primary InstitOwnSorting' }, { label: 'Value ($)', fieldName: 'valuation', cls: 'text-right text-primary InstitOwnSorting' }, { label: 'Reported', fieldName: 'reported', cls: 'text-left text-primary InstitOwnSorting', breakpoints: 'xs sm' }, { label: 'Change', fieldName: 'sharesChanged', cls: 'text-right text-primary InstitOwnSorting', breakpoints: 'xs sm' }] },
- loadingMessage string
-
A message or HTML string to display while first loading the widget.
- Default value
<p class="module_loader">Loading ...</p>
- showPercent boolean
-
Determines if a percent sigh (%) should be displayed after the value.
- Default value
false
- dateFormat string
-
Determines reported date format. Uses jQuery datepicker parsing.
- Default value
m/dd/yy
- useDefaultTpl boolean
-
Append the default template
- Default value
true
- template string
-
Default template for out of the box use
'<div class="InstitutionalOwnershipForm" style="display:none;">' + '<div class="container InsiderOwnership">' + '<h1 class="InsiderOwnershipHeading irwTitle">Institutional Ownership</h1>' + '<div id="InstitutionalOwnershipPanel">' + '<div class="irwDivTable col-xs-12 irwInstitutionalOwnershipDivTable"></div>' + '<div class="clearfix"></div>' + '<div class="irwDivTable col-xs-12">' + '<div class="row bg-primary irwDivTableHeader InstitutionalOwnershipTitle2">' + '<strong>Ownership Activity - <span class="InstitutionalOwnershipView">Total Positions</span></strong>' + '</div>' + '</div>' + '<div class="clearfix"></div>' + '<div class="row visible-sm visible-xs clear irwInstitutionalOwnershipResponsiveTabs"></div>' + '<ul class="nav nav-pills nav-stacked irwCommonTabs col-md-3 irwInstitutionalOwnTabs visible-md visible-lg"></ul>' + '<div class="tab-content col-md-9 irwInstitutionalOwnTabsContent">' + '<div class="tab-pane active HasCustomFields irwInstOwnLoading">' + '<div class="row">' + '<div class="col-md-6">' + '<select id="keyFndg" class="irwInstitutionalOwnSelect form-control security Customform-group">' + '<option value="institution" selected="">Institutional Ownership</option>' + '<option value="mutualfund">Mutual Fund</option>' + '</select>' + '</div>' + '<div class="col-md-6"></div>' + '</div>' + '</div>' + '<div class="row irwInstOwnLoading irwInstOwnTblPannel">' + '<div class="col-md-12 irwInstitutionalOwnContent"></div>' + '</div>' + '<div class="clearfix"></div>' + '<div class="irwTableFooter">' + '<div class="row">' + '<div class="col-xs-12 col-sm-4 col-md-4">' + '<div class="irwpagedisplay">' + 'Displaying 1 to 20 (of )' + '</div>' + '</div>' + '<div class="col-xs-12 col-sm-8 col-md-8">' + '<div class="irwInstitutionalOwnPagination pull-right"></div>' + '</div>' + '</div>' + '</div>' + '</div>' + '</div>' + '</div>' + '</div>'
- summaryTpl string
-
Template to be used for Ownership Information
'<div class="row bg-primary irwDivTableHeader InstitutionalOwnershipTitle1">' + '<strong>Ownership Information</strong>' + '</div>' + '{{#.}}' + '<div class="row irwDivTableRow text-primary">' + '<div class="col-xs-6">' + '<span>{{label}}</span>' + '</div>' + '<div class="col-xs-6 text-right">' + '<span>{{value}}</span>' + '</div>' + '</div>' + '{{/.}}'
- totalTabsTpl string
-
Template to be used for tabs. Only supports the use of html 'li' html tag
'{{#.}}' + '{{#holders}}<li class="text-primary InstitOwnTab" data-type="{{label}}"><a href="#" data-toggle="pill">{{/holders}}' + '{{^holders}}<li class="irwInstOwnNoLink"><a data-toggle="pill">{{/holders}}' + '<h4>{{name}}</h4>' + '{{#holders}}' + '<small class="text-muted tabMuteTitle hidden-xs">' + 'HOLDERS' + '</small>' + '<small class="text-muted hidden-xs pull-left">' + '<strong>{{holders}}</strong>' + '</small>' + '<div class="clearfix"></div>' + '{{/holders}}' + '{{#shares}}' + '<small class="text-muted hidden-xs tabMuteTitle">' + 'SHARES' + '</small>' + '<small class="text-muted hidden-xs pull-left">' + '<strong>{{shares}}</strong>' + '</small>' + '<div class="clearfix"></div>' + '{{/shares}}' + '</a>' + '<div class="irwVerTabsConnect"></div>' + '</li>{{/.}}'
- totalDropDownTpl string
-
A dropdown version of the totals for matching mobile
'<div class="col-md-12">' + '<div class="well" style="overflow: visible;">' + '<div class="btn-group btn-input clearfix irwCustomDropDown">' + '<button type="button" class="btn btn-default dropdown-toggle form-control btn-block" data-toggle="dropdown" aria-expanded="false">' + '<span class="irwCustomDropDownSelected" data-bind="label">Total Positions</span>' + '<span class="caretContainer"> <span class="caret"></span></span>' + '</button>' + '<ul class="dropdown-menu text-primary instOwnerCustomDropDown" role="menu">' + '{{#.}}' + '{{#holders}}<li data-type="{{label}}">{{/holders}}' + '{{^holders}}<li class="irwInstOwnNoLink">{{/holders}}' + '<a class="InstitOwnTab">' + '<span class="irwCustomDropDownItem">{{name}}</span>' + '<div class="clearfix"></div>' + '{{#holders}}' + '<small class="text-muted tabMuteTitle">HOLDERS</small>' + '<small class="text-muted "><strong>{{holders}}</strong></small>' + '{{/holders}}' + '{{#shares}}' + '<small class="text-muted tabMuteTitle">SHARES</small>' + '<small class="text-muted"><strong>{{shares}}</strong></small>' + '{{/shares}}' + '</a>' + '</li>' + '{{/.}}' + '</ul>' + '</div>' + '</div>' + '</div>'
- tableTpl string
-
Template to be used for the details table
'<table class="table Tbl-InsitOwnership irwResponsiveTable table-hover" data-sort="false">' + '<thead>' + '<tr>' + '{{#headers}}' + '<th role="button" class="{{cls}}{{#sortBy}} descending{{/sortBy}}" data-sort="{{#sortBy}}true{{/sortBy}}{{^sortBy}}false{{/sortBy}}" data-order="-1" data-field="{{fieldName}}" {{#breakpoints}}data-breakpoints="xs sm"{{/breakpoints}}>{{label}}</th>' + '{{/headers}}' + '</tr>' + '</thead>' + '<tbody></tbody>' + '</table>'
- tableBodyTpl string
-
Template for the details body to allow for refreshing data without rerendering the entire table
'{{#data}}' + '<tr class="text-primary">' + '<td class="text-left"><span>{{ownerName}}</span></td>' + '<td class="text-center"><span>{{sharesHeld}}</span></td>' + '<td class="text-center"><span>{{outprcnt}}</span></td>' + '<td class="text-right"><span>{{valuation}}</span></td>' + '<td class="text-left"><span>{{reported}}</span></td>' + '<td class="text-right"><span>{{sharesChanged}}</span></td>' + '</tr>' + '{{/data}}'
- paginationTpl string
-
Template to be used for pagination
'<ul class="pagination pull-right HistoricPricesPagination">' + '<li class="pagination_prev" style="display:inline-block;">' + '<button type="button" id="PreviousPage" class="btn-default btn"><i class="fa fa-angle-double-left"></i></button>' + '</li>' + '{{#.}}' + '<li class="pagination_page" data-page="{{.}}" style="display:none;">' + '<button type="button" class="btn btn-default">{{.}}</button>' + '</li>' + '{{/.}}' + '<li class="pagination_next" style="display:inline-block;">' + '<button type="button" id="NextPage" class="btn-default btn"><i class="fa fa-angle-double-right"></i></button>' + '</li>' + '</ul>'
- beforeShowTable function
-
Callback function before showing the results table on load, filter or selection. Can be used for table specific libraries such as FootableJS.
- Parameters
- event function
- Callback function before showing the results table on load, filter or selection. Can be used for table specific libraries such as FootableJS.
- complete function
-
Callback function when widget has loaded the first time.
- Parameters
- event function
- Callback function when widget has loaded the first time.