Namespace: cq-lookup

WebComponents. cq-lookup

Lookup component <cq-lookup>.

Note, a CIQ.ChartEngine.Driver.Lookup must be provided. If none is provided then the default will be used which displays no results.

Use CIQ.UI.Context.setLookupDriver to link the dirver to the cq-lookup web component

Set to force free form text to be converted to uppercase

To turn off the result window modify CSS to .stxMenuActive cq-lookup cq-menu { opacity: 0 }

See function startUI() in sample-template-advanced.html for complete sample implementation.

Since:
  • 4.0.0 Added optional cq-uppercase attribute

Example

<cq-lookup cq-keystroke-claim cq-keystroke-default>
	<cq-lookup-input cq-no-close>
		<input type="text" spellcheck="off" autocomplete="off" autocorrect="off" autocapitalize="off" name="symbol" placeholder="Enter Symbol">
		<cq-lookup-icon></cq-lookup-icon>
	</cq-lookup-input>
	<cq-lookup-results>
		<cq-lookup-filters cq-no-close>
			<cq-filter class="true">ALL</cq-filter>
			<cq-filter>STOCKS</cq-filter>
			<cq-filter>FX</cq-filter>
			<cq-filter>INDEXES</cq-filter>
			<cq-filter>FUNDS</cq-filter>
			<cq-filter>FUTURES</cq-filter>
		</cq-lookup-filters>
		<cq-scroll></cq-scroll>
	</cq-lookup-results>
</cq-lookup>

Methods


results(arr)

Processes an array of results returned by the CIQ.ChartEngine.Driver.Lookup and displays them.

Each element in the array will be of the following format: { display:["symbol-id","Symbol Description","exchange"], data:{ symbol:"symbol-id", name:"Symbol Description", exchDis:"exchange" } }

The lookup widget by default displays three columns as represented by the array. The data object can be an format required by your QuoteFeed or it can be a simple string if you just need to support a stock symbol.

Parameters:
Name Type Description
arr Array

The array of results.


selectItem(data, params)

Accepts a new symbol or symbolObject

Parameters:
Name Type Description
data Object

The symbol object (in a form accepted by CIQ.ChartEngine#newChart)

params Object

Settings to control callback action


setCallback(cb)

Set a callback method for when the user selects a symbol

Parameters:
Name Type Description
cb function

Callback method


setDriver(driver)

Set a CIQ.ChartEngine.Driver.Lookup. If none is set then CIQ.UI.Context.lookupDriver will be used. If none available then the input box will still be active but not present a drop down.

Parameters:
Name Type Description
driver CIQ.ChartEngine.Driver.Lookup

The driver