Q columns Class
This tool contains functionality to show things in columns
Constructor
Q columns
-
[options]
Parameters:
-
[options]
Object optionalOverride various options for this tool
-
[title]
String optionalYou can put a default title for all columns here (which is shown as they are loading)
-
[column]
String optionalYou can put a default content for all columns here (which is shown as they are loading)
-
[controls]
String optionalYou can put default controls HTML for all columns here (which is shown as they are loading)
-
[data]
Object optionalAny data you want to associate with the column, to be retrieved later by the tool.data() method
-
[attributes]
Object optionalAny attributes you want to add to the column element
-
[animation]
Object optionalFor customizing animated transitions
-
[back]
Object optionalFor customizing the back button on mobile
-
[src]
String optionalThe src of the image to use for the back button -
[triggerFromTitle]
Boolean optionalWhether the whole title would be a trigger for the back button. Defaults to true. -
[hide]
Boolean optionalWhether to hide the back button. Defaults to false, but you can pass true on android, for example.
-
-
[textfill={}]
Object optionalOptions for Q/textfill on the title, or pass null here to skip this effect.
-
[close]
Object optionalFor customizing the back button on desktop and tablet
-
[scrollbarsAutoHide]
Object optionalIf an object, enables Q/scrollbarsAutoHide functionality with options from here. Enabled by default.
-
[handlers]
Object optionalPairs of columnName: handler where the handler can be a function or a string, in which you assign a function to Q.exports .
-
[fullscreen]
Boolean optionalWhether to use fullscreen mode on mobile phones, using document to scroll instead of relying on possibly buggy "overflow" CSS implementation. Defaults to true on Android stock browser, false everywhere else.
-
[hideBackgroundColumns=true]
Boolean optionalWhether to hide background columns on mobile (perhaps improving browser rendering).
-
[pagePushUrl]
Boolean optionalif this is true and the url of the column is specified, then Q.Page.push() is called with this URL.
-
[beforeOpen]
Q.Event optionalEvent that happens before a column is opened. Return false to prevent opening. Receives (options, index).
-
[beforeClose]
Q.Event optionalEvent that happens before a column is closed. Receives (index, indexAfterClose, columnElement). Return false to prevent closing.
-
[onOpen]
Q.Event optionalEvent that happens after a column is opened. Receives (options, index, columnElement).
-
[afterDelay]
Q.Event optionalEvent that happens after a column is opened, after a delay intended to wait out various animations. Receives (options, index, columnElement).
-
[onClose]
Q.Event optionalEvent that happens after a column is closed.
-
Returns:
Methods
close
-
index
-
callback
-
options
Closes a column
Parameters:
-
index
Number | Array | ObjectThe index of the column to close. You can pass an array of indexes here, or an object with "min" and optional "max"
-
callback
FunctionCalled when the column is closed, or if no column Receives (index, column) where the column could be null if it wasn't found.
-
options
ObjectCan be used to override some values taken from tool state
Returns:
Whether the column was actually closed.
open
-
options
-
index
-
callback
Opens a column
Parameters:
-
options
ObjectCan be used to override various tool options, including events such as "onOpen" and "onClose". Additional options include:
-
[name]
String optionalany name to assign to the column
-
[columnClass]
String optionalto add a class to the column
-
[data]
Object optionalto add data on the column element with jQuery
-
[template]
Object optionaltemplate to render for the "column" slot
-
[fields]
Object optionalfields for the template, if any
-
[title]
Object optionaloverride the title of the column
-
[column]
Object optionaloverride the html of the column
-
[url]
Object optionala url to request the slots "title" and "column" from
-
-
index
NumberThe index of the column to open
-
callback
FunctionCalled when the column is opened
Returns:
Whether the column will be opened
pop
-
callback
-
options
Closes the last column