DOCUMENTATION

Note: You may have to download the current version of mysql ajax table editor in order to use all the options and features listed below.

PERMISSIONS
Permissions can be set on a per column basis and on a table basis. Example Source Code
The available permissions are:
E - Edit
A - Add
C - Copy
V - View
D - Delete
X - Export
Q - Quick Search
S - Advanced search
I - Icons - Displays icons on each row for edit, copy, view and delete options.
M - Multiple - Displays checkboxes on each row for edit, copy, view and delete actions (also used for user buttons with call backs).
U - User defined display per page number.
T - Display in table.

CONFIGURATION SETUP OPTIONS AND CALL BACK FUNCTIONS
userIcons - Add extra icons with a call back function (for user icons to be displayed the I permission must be set).
Usage 1
$userIcons[] = array('icon_html' => 'html for icon');
$Editor->setConfig('userIcons',$userIcons);
The replaceWithId string will be replaced with the primary column value.
Usage 2
$userIcons[] = array('format_fun' => 'callback function to format icons');
$Editor->setConfig('userIcons',$userIcons);
The current row's information will be passed to the callback function. The call back function must return an associative array in the following format array('icon_html' => 'html for icons', 'num_icons' => 'number of icons').
Usage 3
$userIcons[] = array('class' => 'icon class', 'title' => 'icon title','callback_fun' => 'callback function that is called when icon is clicked');
Optional Parameters:
no_update - Set this to true if you do not want the table to be redrawn after the call back executes.
confirm_msg - Set a confirmation message that will appear before the call back executes.
$Editor->setConfig('userIcons',$userIcons);
An associative array of the clicked row's information will be passed to the function.
addScreenFun - Call back to manipulate html on the add screen (no data is passed).
editScreenFun - Call back to manipulate html on the edit screen (no data is passed).
viewScreenFun - Call back to manipulate html on the view screen (no data is passed).
tableScreenFun - Call back to manipulate html on the table screen (no data is passed).
afterCopyFun - Call back function that is called after a row is copied.
The new row's insert id and an associative array of columns and values are passed to the call back function.
afterEditFun - Call back function that is called after a row is edited.
The primary column value, primary column name and an associative array of columns and values are passed to the call back function.
afterAddFun - Call back function that is called after a row is added.
The new row's insert id, primary column name and an associative array of columns and values are passed to the call back function.
afterDeleteFun - Call back function that is called after a row is deleted.
The deleted row's primary column value and primary column name are passed to the call back function.
tableInfo - A hash of html attributes that will be placed in the table tag.
oddRowColor - Set color of odd rows.
evenRowColor - Set color of even rows.
userButtons - Create a user button with a call back function, a hash of html attributes or your own custom button (If a call back function is used the M permission must be set).
Usage 1
$userButtons[] = array('button_html' => 'html for button');
$Editor->setConfig('userButtons',$userButtons);
Usage 2
$userButtons[] = array('label' => 'label for button', 'call_back_fun' => 'Call back that will be called on button press. All checked rows will be passed through the call back');
Optional Parameters:
confirm_msg - Set a confirmation message that will appear before the call back executes.
$Editor->setConfig('userButtons',$userButtons);
Usage 3
$userButtons[] = array('label' => 'label for button', 'button_info' => 'hash of html attributes that will be placed in the button tag');
$Editor->setConfig('userButtons',$userButtons);
defNumAdvSearches - Change the default number of advanced searches (when toggling between quick and advanced searches).
numAdvSearches - Set the default number of advanced searches (when page loads for the first time). This option will only need to be used if you are setting the searchType option to advanced.
addRowTitle - Set add row title.
editRowTitle - Set edit row title.
viewRowTitle - Set view row title.
tableTitle - Set table title.
orderByColumn - Set default order by column.
ascOrDesc - Set default ascending or descending.
displayNum - Set display per page (do not set this variable if U permission is being used).
displayNumInc - Set the display increment for the user defined display drop down.
maxDispNum - Set the maximum number of rows that can be displayed on one page.
dbName - Set the database name (this is used to join tables on different databases).
searchType - Set search type (quick or advanced).
replaceWithId - String that will be replaced by the row id in the user icon html (default is "#primaryColValue#").
useHightlight - Turn highlighting on quick searches off.
highlightHash - Set the highlight css for quick searches.
$Editor->setConfig('highlightHash','color: red; font-weight: bold;');
userActions - Set custom user actions that can be called from javascript events.
$Editor->setConfig('userActions',array('action_name' => 'call back function'));
Javascript to call user action: "toAjaxTableEditor('action_name',this.value);". This javascript could be placed in an onchange tag in a drop down or an onblur tag in a text input or any other place where a javascript event can be triggered. Dynamic Form Example
extraOrderByInfo - Set a second or third... order by column
$Editor->setConfig('extraOrderByInfo','col2Name asc, col3Name desc');
userColumns - Add your own user defined columns with and format them with a call back function.
$userColumns[] = array('call_back_fun' => 'function to format data in column');
Optional Parameters:
title - Set a title for the column.
$Editor->setConfig('userColumns',$userColumns);
An associative array of the current row's information will be passed to the call back function.
iconColPosition - This variable is used to set the position of the add, edit, copy and delete icons. The possible values are first and last (default is last). To set this variable use the following code.
$Editor->setConfig('iconColPosition','first');

COLUMN OPTIONS
display_text - Text that gets displayed for the field.
req - Make a field required.
default - Set default value of field.
select_array - Associative array for a select drop down list (array keys are the select values and array values are what get displayed).
select_query - Query to create drop down list (must return 2 columns: the first column is the select values and the second column is what gets displayed).
hidden_add - Make a field hidden on add.
hidden_edit - Make a field hidden on edit.
calendar - Make a javascript date selector calendar. Values can be a true, false or a date format (the default format is '%B %d, %Y'). All Formats
mysql_add_fun - Use a mysql function when inserting a row.
mysql_edit_fun - Use a mysql function when updating a row.
data_filters - Apply multiple data filters to a field.
'data_filters' => array('filters' => array("like '%c%'","like '%f%'"), 'criteria' => 'this is optional see below')
Optional Parameters:
criteria - Possible values are "any" or "all" the default is "all", which means all data filters will have to be matched for a row to be displayed. If criteria is set to "any" only one of the data filters will have to be matched for the row to be displayed.
join - Join a field to another table.
'join' => array('table' => 'table to join on', 'column' => 'column to join on')
Optional Parameters:
display_mask - Mask joined value with different columns or a mysql function or both. View Example Source Code
type - Set join type, default is left.
db - Specify a different database.
real_column - This parameter is used when you want to display the join column once without a join and once with a join. It can also be used to simulate a join on the primary key. If you need to do this email me and I will send you some code.
textarea - Use a textarea.
'textarea' => array('rows' => 5, 'cols' => 30)
col_header_info - Set html attributes or css styles to go in the column header.
'col_header_info' => 'width="150" style="border: 1px solid #333;"'
display_mask - Mask a column with a mysql function.
input_info - html attribute hash that will be added to the input, select or textarea tags on add and edit.

COLUMN CALL BACK FUNCTION
format_input_fun - Format input on add and edit screens.
table_fun - Format, add or change data before it is displayed on the table screen.
csv_export_fun - Format, add or change data before it is exported.
view_fun - Format, add or change data before it is displayed on the view screen.
edit_fun - Format, add or change data before it is displayed on the edit screen.
add_fun - Format, add or change data before it is displayed on the add screen.
val_fun - Check field validation on add and edit screens.
on_edit_fun - Format/change user value before update.
on_add_fun - Format/change user value before insert.
on_copy_fun - Format/change value before copy.