You are on page 1of 3

AjaxCRUD.com ajaxCRUD API - Use PHP & AJAX to CRUD from ...

http://www.ajaxcrud.com/api/

ajaxCRUD.com

a PHP class to create / read / update / delete from a database table using AJAX
by loud canvas media Home Documentation License Examples Download SUPPORT Contact Us

AjaxCRUD API Reference


Object: ajaxCRUD
CONSTRUCTOR
Name Requires Returns object Default Short description Example

ajaxCRUD

constructor for instantiating the Example class (String buttonText, String dbTableName, String dbPrimaryKey) More...

FUNCTIONS
Name Requires Returns void all fields searchable void void no button Default Short description adds a search box at the top of the page More... adds searchboxs for all fields in your table More... Example

addAjaxFilterBox addAjaxFilterBoxAllFields addButton addButtonToRow

Example Example

adds a button to the bottom of Example the page More... adds a button to every row and sends the id (pk) of that item to any url More...

Example

addOrderBy addTableBorder

void void off

orders the table by a specified Example field More... adds a border to the html table Example this function is deprecicated! -- please use setCSSFile to control style/layout

More... addValueOnInsert addWhereClause appendUploadFilename setFileUpload


void void null no value appended void sets a value to a field on row insert More... adds an sql "where clause" to the query More...

Example Example

append the value of the row to Example the beginning of the filename

More... defineAllowableValues
define "allowable" values for a Example field. More...

1 de 3

10/03/2011 03:38 p.m.

AjaxCRUD.com ajaxCRUD API - Use PHP & AJAX to CRUD from ...

http://www.ajaxcrud.com/api/

defineCheckbox defineRelationship

void void

1,0

Sets the field to be of type 'checkbox'. More...

Example

defines a relationship between Example your table and another (via the foreign key) More... disallow new rows to be added to the table More... disallows row deletion

disallowAdd disallowDelete disallowEdit displayAs

void void void void actual field name non-formated data

Example Example Example

More...
disallows a field to be edited

More...
displays the a field name in the Example table under a psudoname.

More... formatFieldWithFunction omitAddField


formatted data void format data in a column with a Example custom function More... omits the input field from Example displaying when adding a row

More... omitField omitFieldCompletely


void omits a field from displaying in Example the table More... field not omited this function calls both omitField and omitAddField for a field

Example

More... omitPrimaryKey onAddExecuteCallBackFunction


(callback function) void void omits the primary key from Example displaying in the table More... calls a local function when a new row is added More...

Example

onDeleteFileExecuteCallBackFunction setFileUpload, (callback function) void

calls a local function when a Example file (that was previously uploaded) is deleted More... calls a local function when a file is uploaded More... 10 sets the size (lengh of the textbox) of an ajax filter box

onFileUploadExecuteCallBackFunction setFileUpload, your callback


function

void

Example Example

setAjaxFilterBoxSize

addAjaxFilterBox or addAjaxFilterBoxAllFields
void

More... setCSSFile
default.css Sets a css file as the stylesheet Example to be used to render the table.

More... setFileUpload
web-safe filename of uploaded file (on upload void void void 50 input box allows a field to accept file uploads More...

Example

setLimit setTextareaHeight showCheckboxAll

set the limit of number of rows Example to display More... Sets the textarea height for a field More...

Example

Set ALL checkboxes for a Example field (in a column) to be on of off. More... function to "run" the script / display the table More... (ajax used for adding a row) Turns off ajax for the CREATE crud operation (adding a row). More...

showTable turnOffAjaxADD

ajaxCRUD (the constructor)

void (displays the table) void

Example Example

turnOffAjaxEditing turnOffPaging

void paging at 50/page

turns off the ability to edit ALL Example fields. More... turn off paging so total rows returns maxes at a value

Example

More...

VARIABLES
Name Requires Type Default Short description Example

2 de 3

10/03/2011 03:38 p.m.

AjaxCRUD.com ajaxCRUD API - Use PHP & AJAX to CRUD from ...

http://www.ajaxcrud.com/api/

cellspacing

variable

cellspacing for the html table Example


that displays the database table

css emptyTableMessage hover_color

variable variable variable

true

set to false if you don't want to use a css stylesheet More... The message that appears when a table is empty.

Example Example

#B1CFF5 (a light blue) false

color when you hover over a cell to change its value

More... showCheckbox
variable puts a checkbox in front of each row More...

Example

New

"Thanks for the great script, you rock big time." ~Daniel Copyright 2011 Loud Canvas Media. for non-commercial use. | AjaxCRUD is a free, open-source PHP API

3 de 3

10/03/2011 03:38 p.m.

You might also like