![]() |
Framework
3.9
|
Public Member Functions | |
SpreadsheetForm ($subform, $items=array(), $blanks=5, $method="POST", $action="", $id="", $onStartRow=null, $isRowSelected=null) | |
Creates a new SpreadsheetForm. More... | |
showRowLabels ($columnTitle, $format, $defaultText) | |
createSpreadsheetRowForms ($items, $subform) | |
createOneSpreadsheetRow ($item, $row, $validator, $idx) | |
setColumnWidth ($field, $width) | |
Set the td width for the table. More... | |
ajaxSubmit ($success, $failure=null) | |
Put the form into AJAX submission mode. More... | |
writeScript () | |
Generates the Javascript for all the subforms, and creates a SpreadsheetFormManager object. More... | |
drawForm () | |
Draws the spreadsheet. More... | |
save () | |
Overrides CompositeAutoForm::save() to provide support for selectable spreadsheet forms. More... | |
getQueryString ($qs="") | |
![]() | |
CompositeAutoForm ($method="POST", $action="", $containerClass="") | |
Creates a new CompositeAutoForm. More... | |
addForm ($form, $enableValidation=false) | |
Add a sub-form to this form. More... | |
preset () | |
Array of fields to be ignored when determining if a record is empty in cases where empty records should not trigger an error. More... | |
drawReadOnly () | |
Draw the read-only sub-forms. More... | |
button ($text, $url, $confirm=null, $isScript=false) | |
Adds a custom button to the form. More... | |
drawButtons () | |
Draws any additional buttons specified in the calling script. More... | |
Public Attributes | |
$colCount = 0 | |
$subform | |
The prototype subform used to model each row in the spreadsheet. More... | |
$columnWidths = array() | |
Array of column widths, used to control relative cell sizes in the table output. More... | |
$msg | |
Text to appear below buttons at top and above table. More... | |
$onStartRow = null | |
Callback hook to determine row style or suppression of row. More... | |
$isRowSelected = null | |
Callback hook to determine whether a given row is selected. Assigning a callback to this hook turns on selection mode. Only selected sub-forms are saved. More... | |
$isRowEmpty = null | |
Callback hook to determine if a given row should be saved, or skipped because it is an empty row. More... | |
$rowLabelFormat = null | |
$rowLabelTitle = null | |
$rowLabelDefaultText = "" | |
$emptyMessage = "The spreadsheet is empty" | |
The message to display if the item list is empty and the number of blank rows is set to zero. More... | |
$onFormChanged = null | |
Javascript function to be called when any value is changed within the spreadsheet. More... | |
$ajaxSubmitHandler = false | |
JavaScript Callback for AJAX Submit mode - called on success. More... | |
$ajaxFailureHandler = false | |
JavaScript Callback for AJAX Submit mode - called on failure. More... | |
![]() | |
$forms | |
$buttons = array() | |
$method | |
$action | |
$containerClass | |
$buttonAlignment = "left" | |
$preset = array() | |
$readOnlyForm | |
Specifies whether the entire form is read-only. More... | |
$onSaveComplete = null | |
Callback event handler that is fired after all the subordinate AutoForms have finished saving data to the database. More... | |
Provides input forms in a spreadsheet layout where each row is a subform containing one dataitem object's field renderers.
Definition at line 48 of file spreadsheet_form.inc.
SpreadsheetForm::ajaxSubmit | ( | $success, | |
$failure = null |
|||
) |
Put the form into AJAX submission mode.
You must supply a Javascript function to call once the submission is complete.
string | $success | the Javascript callback function for success |
string | $failure | the Javascript callback function for failure |
Definition at line 234 of file spreadsheet_form.inc.
SpreadsheetForm::createOneSpreadsheetRow | ( | $item, | |
$row, | |||
$validator, | |||
$idx | |||
) |
Definition at line 146 of file spreadsheet_form.inc.
SpreadsheetForm::createSpreadsheetRowForms | ( | $items, | |
$subform | |||
) |
Definition at line 121 of file spreadsheet_form.inc.
SpreadsheetForm::drawForm | ( | ) |
Draws the spreadsheet.
Each row is a subordinate form instance with the renderers cloned from the prototype row form supplied in the constructor.
Reimplemented from CompositeAutoForm.
Definition at line 289 of file spreadsheet_form.inc.
SpreadsheetForm::getQueryString | ( | $qs = "" | ) |
Definition at line 489 of file spreadsheet_form.inc.
SpreadsheetForm::save | ( | ) |
Overrides CompositeAutoForm::save() to provide support for selectable spreadsheet forms.
Reimplemented from CompositeAutoForm.
Definition at line 433 of file spreadsheet_form.inc.
SpreadsheetForm::setColumnWidth | ( | $field, | |
$width | |||
) |
Set the td width for the table.
string | $field | |
number | $width |
Definition at line 223 of file spreadsheet_form.inc.
SpreadsheetForm::showRowLabels | ( | $columnTitle, | |
$format, | |||
$defaultText | |||
) |
Definition at line 114 of file spreadsheet_form.inc.
SpreadsheetForm::SpreadsheetForm | ( | $subform, | |
$items = array() , |
|||
$blanks = 5 , |
|||
$method = "POST" , |
|||
$action = "" , |
|||
$id = "" , |
|||
$onStartRow = null , |
|||
$isRowSelected = null |
|||
) |
Creates a new SpreadsheetForm.
AutoForm | $subform | an instance of AutoForm containing the target DataItem object. The target should have the filters set as desired and those filters will apply to all objects displayed in the spreadsheet. The "template" form should have any field aliases, hidden fields, and any other options set. The template form will be used for all the items displayed. |
array | $items | array of dataitem objects to be displayed in an editable table row. If you wish to display only empty rows, send an empty array. |
number | $blanks | the number of blank rows desired, 0 if only previously saved dataitem objects supplied in the items array will be displayed. |
string | $method | the form submission method (i.e. GET or POST) |
string | $action | the target action URI (leave blank for default post-back processing) |
string | $id | the DOM id for the spreadsheet |
string | $onStartRow | callback to be called before generating each row |
string | $isRowSelected | callback to determine the selection status for each row |
Definition at line 90 of file spreadsheet_form.inc.
SpreadsheetForm::writeScript | ( | ) |
Generates the Javascript for all the subforms, and creates a SpreadsheetFormManager object.
Reimplemented from CompositeAutoForm.
Definition at line 249 of file spreadsheet_form.inc.
SpreadsheetForm::$ajaxFailureHandler = false |
JavaScript Callback for AJAX Submit mode - called on failure.
Definition at line 63 of file spreadsheet_form.inc.
SpreadsheetForm::$ajaxSubmitHandler = false |
JavaScript Callback for AJAX Submit mode - called on success.
Definition at line 62 of file spreadsheet_form.inc.
SpreadsheetForm::$colCount = 0 |
Definition at line 50 of file spreadsheet_form.inc.
SpreadsheetForm::$columnWidths = array() |
Array of column widths, used to control relative cell sizes in the table output.
Definition at line 52 of file spreadsheet_form.inc.
SpreadsheetForm::$emptyMessage = "The spreadsheet is empty" |
The message to display if the item list is empty and the number of blank rows is set to zero.
Definition at line 60 of file spreadsheet_form.inc.
SpreadsheetForm::$isRowEmpty = null |
Callback hook to determine if a given row should be saved, or skipped because it is an empty row.
Definition at line 56 of file spreadsheet_form.inc.
SpreadsheetForm::$isRowSelected = null |
Callback hook to determine whether a given row is selected. Assigning a callback to this hook turns on selection mode. Only selected sub-forms are saved.
Definition at line 55 of file spreadsheet_form.inc.
SpreadsheetForm::$msg |
Text to appear below buttons at top and above table.
Definition at line 53 of file spreadsheet_form.inc.
SpreadsheetForm::$onFormChanged = null |
Javascript function to be called when any value is changed within the spreadsheet.
Definition at line 61 of file spreadsheet_form.inc.
SpreadsheetForm::$onStartRow = null |
Callback hook to determine row style or suppression of row.
Definition at line 54 of file spreadsheet_form.inc.
SpreadsheetForm::$rowLabelDefaultText = "" |
Definition at line 59 of file spreadsheet_form.inc.
SpreadsheetForm::$rowLabelFormat = null |
Definition at line 57 of file spreadsheet_form.inc.
SpreadsheetForm::$rowLabelTitle = null |
Definition at line 58 of file spreadsheet_form.inc.
SpreadsheetForm::$subform |
The prototype subform used to model each row in the spreadsheet.
Definition at line 51 of file spreadsheet_form.inc.