\apex\core\ajaxsort_table

Class that handles the AJAX based sorting of data tables.

Summary

Methods
Properties
Constants
process()
alert()
clear_table()
remove_checked_rows()
add_data_rows()
set_pagination()
prepend()
append()
play_sound()
set_text()
set_display()
clear_list()
$results
No constants found
add()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$results

$results : 

Type

Methods

process()

process() 

Sort table via AJAX

Sorts a table. Removes all existing table rows, retrives the new rows from the 'table' component, and displays them in the browser. Used when clicking the up/down sort arrows in a data table column header.

alert()

alert(string  $message) 

Opens a dialog in the browser containing the provided message via the Javascript alert() function.

Parameters

string $message

The message to display.

clear_table()

clear_table(string  $divid) 

Deletes all rows within the <tbody> of specified table. ( Used for pagination, quick search, and sorting rows via AJAX.

Parameters

string $divid

The element ID of the table.

remove_checked_rows()

remove_checked_rows(string  $divid) 

Removes all rows that contain a checked checkbox from the <tbody> of the specified table.

Parameters

string $divid

The element ID of the table.

add_data_rows()

add_data_rows(string  $divid, string  $table_alias, array  $rows, array  $data = array()) 

Adds one or more rows to a table. Used for a variety of reasons including search, sort, and pagination.

Parameters

string $divid

The element ID of the table.

string $table_alias

The alias of the data table component, formatted PACKAGE:ALIAS

array $rows

An array of associative arrays that contain the table row(s) to add. Same as returned from $table->get_rows() method.

array $data

Any additional data / attributes from within the tag that called the table.

set_pagination()

set_pagination(string  $divid, array  $details) 

Sets the pagination links of a data table component. Used during pagination, search, and sort of a table.

Parameters

string $divid

The element ID of the table / pagination links

array $details

Table details as provided by the 'apex\core\table_functions\get_details' method.

prepend()

prepend(string  $divid, string  $html) 

( Prepend text to an element.

Parameters

string $divid

The ID# of the DOM element to prepend to

string $html

THe HTML to prepent.

append()

append(string  $divid, string  $html) 

Append text to an element

Parameters

string $divid

The ID# of the DOM element to append to

string $html

THe HTML to append

play_sound()

play_sound(string  $wav_file) 

Play found file

Parameters

string $wav_file

THe name of the WAV file found in the /public/plugins/sounds/ directory of Apex

set_text()

set_text(string  $divid, string  $text) 

Set text of a DOM element 9the innerHTML attribute)

Parameters

string $divid

The ID# of the DOM element to modify

string $text

The new text of the DOM element (innerHTML attribute)

set_display()

set_display(string  $divid, string  $display) 

Set display of a DOM element (general visible, none, block, etc.)

Parameters

string $divid

The ID# of the DOM element

string $display

The display to set the DOM element to

clear_list()

clear_list(string  $divid) 

Clear all items from a list

Parameters

string $divid

The ID# of the list to clear all items from

add()

add(string  $action, array  $vars) 

Add AJAX action

Adds an entry to the self::$actions array. Upon request completion, this array is formatted into JSON, and returned to the browser for processing via Javascript.

Parameters

string $action

The action to perform within the web browser.

array $vars

An array containing all necessary variables, different for each action.