ajaxCRUD.com
» a PHP API to create / read / update / delete from a database table using AJAX
by loud canvas mediaAjaxCRUD API Reference
Object: ajaxCRUD | |||||
Constructor | |||||
| Name | Requires | Returns | Default | Short description | Example |
|---|---|---|---|---|---|
| ajaxCRUD | object | constructor for instantiating the class (String buttonText, String dbTableName, String dbPrimaryKey) More... |
Example | ||
Functions | |||||
| Name | Requires | Returns | Default | Short description | Example |
| addAjaxFilterBox | void | adds a search box at the top of the page More... | Example | ||
| addAjaxFilterBoxAllFields | all fields searchable | adds searchboxs for all fields in your table More... | Example | ||
| addButton | void | adds a button to the bottom of the page More... | Example | ||
| addButtonToRow | void | no button | adds a button to every row and sends the id (pk) of that item to any url More... | Example | |
| addOrderBy | void | orders the table by a specified field More... | Example | ||
| addTableBorder | void | off | adds a border to the html table
|
Example | |
| addValueOnInsert | void | sets a value to a field on row insert More... | Example | ||
| addWhereClause | void | null | adds an sql "where clause" to the query More... | Example | |
| appendUploadFilename | setFileUpload | no value appended | append the value of the row to the beginning of the filename More... | Example | |
| defineAllowableValues | void | define "allowable" values for a field. More... | Example | ||
| defineCheckbox | void | 1,0 | Sets the field to be of type 'checkbox'. More... | Example | |
| defineRelationship | void | defines a relationship between your table and another (via the foreign key) More... | Example | ||
| disallowAdd | void | disallow new rows to be added to the table More... | Example | ||
| disallowDelete | void | disallows row deletion More... | Example | ||
| disallowEdit | void | disallows a field to be edited More... | Example | ||
| displayAs | void | actual field name | displays the a field name in the table under a psudoname. More... | Example | |
| formatFieldWithFunction | formatted data | non-formated data | format data in a column with a custom function More... | Example | |
| omitAddField | void | omits the input field from displaying when adding a row More... | Example | ||
| omitField | void | omits a field from displaying in the table More... | Example | ||
| omitFieldCompletely | field not omited | this function calls both omitField and omitAddField for a field More... | Example | ||
| omitPrimaryKey | void | omits the primary key from displaying in the table More... | Example | ||
| onAddExecuteCallBackFunction | (callback function) | void | calls a local function when a new row is added More... | Example | |
| onDeleteFileExecuteCallBackFunction | setFileUpload, (callback function) | void | calls a local function when a file (that was previously uploaded) is deleted More... | Example | |
| onFileUploadExecuteCallBackFunction | setFileUpload, your callback function | void | calls a local function when a file is uploaded More... | Example | |
| setAjaxFilterBoxSize | addAjaxFilterBox or addAjaxFilterBoxAllFields | 10 | sets the size (lengh of the textbox) of an ajax filter box More... | Example | |
| setCSSFile | void | default.css | Sets a css file as the stylesheet to be used to render the table. More... | Example | |
| setFileUpload | web-safe filename of uploaded file (on upload | allows a field to accept file uploads More... | Example | ||
| setLimit | void | 50 | set the limit of number of rows to display More... | Example | |
| setTextareaHeight | void | input box | Sets the textarea height for a field More... | Example | |
| showTable | ajaxCRUD (the constructor) | void (displays the table) | function to "run" the script / display the table More... | Example | |
| turnOffAjaxADD | void | (ajax used for adding a row) | Turns off ajax for the CREATE crud operation (adding a row). More... | Example | |
| turnOffAjaxEditing | void | turns off the ability to edit ALL fields. More... | Example | ||
| turnOffPaging | paging at 50/page | turn off paging so total rows returns maxes at a value More... | Example | ||
Variables | |||||
| Name | Requires | Type | Default | Short description | Example |
| cellspacing | variable | 0 | cellspacing for the html table that displays the database table | Example | |
| css | variable | true | set to false if you don't want to use a css stylesheet More... | ||
| hover_color | variable | #B1CFF5 (a light blue) | color when you hover over a cell to change its value More... | Example | |
| showCheckbox | variable | false | puts a checkbox in front of each row More... | Example | |
"I love AjaxCRUD! It's saved me hours upon hours of typing!"
~Eric Duwenhoegger
"AjaxCRUD is wonderful."
~Peter Barone
