Class jQuery.tabulate
Contains all of the members and methods needed by tabulate.
Defined in: jquery.tabulate.js.
Constructor Attributes | Constructor Name and Description |
---|---|
The tabulate class.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
jQuery.tabulate.cache
Contains any data that has already been loaded.
|
<static> |
jQuery.tabulate.columns
The number of columns in the table (at its widest point).
|
<static> |
jQuery.tabulate.current_count
The current number of rows in the data set.
|
<static> |
jQuery.tabulate.current_page
The "page" of the data set that is currently being viewed.
|
<static> |
jQuery.tabulate.total_count
The total number of rows in the data set.
|
<static> |
jQuery.tabulate.total_pages
The total number of "pages" in the data set that are available for
viewing.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
jQuery.tabulate.apply_properties(jQuery, Object, properties)
Applies properties to rows and cells in the table.
|
<static> |
jQuery.tabulate.build_section(String, Object, Object)
Builds and appends a section of the table.
|
<static> |
jQuery.tabulate.error()
Convenience function for displaying error information.
|
<static> |
jQuery.tabulate.gather_data(Object, Object)
Gathers the data needed for tabulation.
|
<static> |
jQuery.tabulate.go_to(integer)
Updates jQuery.tabulate.current_page to point to the specified
page.
|
<static> |
jQuery.tabulate.init(jQuery, object)
Initializes the tabulate class.
|
<static> |
jQuery.tabulate.next(element)
Updates jQuery.tabulate.current_page to point to the next page.
|
<static> |
jQuery.tabulate.previous(element)
Updates jQuery.tabulate.current_page to point to the previous
page.
|
<static> |
jQuery.tabulate.tabulate(Object)
Given data, builds a tabular view of that data.
|
<static> |
jQuery.tabulate.toString()
Object.toString override
|
<static> |
jQuery.tabulate.trigger(String, Array)
Convenience function for triggering events.
|
<static> |
jQuery.tabulate.update_filters(Object, Boolean, Object)
Updates the filters that will be applied to the current data set.
|
- Default Value:
- 0
This value is set by counting the number of "data" items within the returned data set.
- See:
- jQuery.tabulate.keys.data
- Default Value:
- 0
Used by the internal pagination system to limit the current view of the data set. This variable is modified by the navigation functions.
- Default Value:
- 1
This value may be set within the data set to allow for lazy-loading data (not loading it all at once).
- See:
- jQuery.tabulate.keys.count
- Default Value:
- 0
This value is calculated in jQuery.tabulate.tabulate based upon the values of jQuery.tabulate.count and jQuery.tabulate.filters.limit.
- Default Value:
- 1
- Parameters:
- jQuery
- $element The element to apply the properties to.
- Object
- settings An object containing settings for the
- properties
- Returns:
- jQuery The modified element
- See:
- jQuery.table.body.rows
- jQuery.table.body.cells
- Parameters:
- String
- section The name of the section
- Object
- options Contains the section key, $section fragment and any additional properties to bestow upon the section.
- Object
- data The data given to tabulate
Data can either be passed in explicitly or loaded via jQuery.ajax. This function expects a "request" parameter, however, if none is passed it will use the default data request object that was passed into tabulate upon initialization.
If a request is found, this function will trigger jQuery.tabulate.event_handlers.event:loading with true as its argument, effectively turning it on. After the data type is determined and the data has been gathered this function will trigger jQuery.tabulate.event_handlers.event:post_load with the data object as its argument. It is important to note that if both an AJAX request and a JSON object are passed to this function, the result of the two will be merged together before being passed to the post_load event handler.
- Parameters:
- Object
- request The request object.
- Object
- filters Filters that will apply to this request only.
This function first checks to make sure the specified page exists, then sets current_page to its value. Finally, it triggers jQuery.tabulate.event_handlers.event:refresh.
- Parameters:
- integer
- page An integer value specifying the page to go to.
Merges default options with those passed in, builds the table skeleton, creates jQuery objects from jQuery.tabulate.options.elements and binds any needed event handlers. Finally, triggers jQuery.tabulate.event_handlers.event:post_init.
- Parameters:
- jQuery
- $wrapper The element(s) passed in from jQuery.fn.tabulate.
- object
- options Options to overwrite the default ones with.
This function first checks to make sure we have a next page to go to, then increments current_page. Finally, it triggers jQuery.tabulate.event_handlers.event:refresh.
- Parameters:
- element
- element The DOM element that was clicked.
This function first checks to make sure we have a previous page to go to, then decrements current_page. Finally, it triggers jQuery.tabulate.event_handlers.event:refresh.
- Parameters:
- element
- The DOM element that was clicked.
This function fires jQuery.tabulate.post_tabulate when it finishes.
- Parameters:
- Object
- data The object containing the data to tabulate.
- Returns:
- String "[object instance.name]"
Note that this function automatically wraps handlers in the namespace of the current instance.
- Parameters:
- String
- name The name of the event handler.
- Array
- args The Array of arguments to pass to the handler function.
- Parameters:
- Object
- filters The filters to apply to the data set.
- Boolean
- overwrite Whether or not to overwrite the current filters with the new filters. Defaults to true. If false, the two filter objects would be merged.
- Object
- refresh Whether or not to call the refresh handler. Defaults to true.