zpm.dataview.js Documentation

Data View library for the ZPM.Net framework.
"Public" methods are intended to be called outside the dataview class.
"Internal" methods are indended for use within the dataview class.

under construction.

Public void ZpmDataView(viewId, modelTextName, getModelMethodName, focusOnChange, focusOnAdd) - constructor for the ZpmDataView class

Parameter viewId: id of content <div> containing the entire data view.
Parameter modelTextName: Name of the model, like Customer or Employee.
Parameter getModelMethodName: Server method used to get a model, example: /Customer/GetModel.
Parameter focusOnChange: element id to focus on when changing a model
Parameter focusOnAdd: element id to focus on when adding a model

All of the ZPM.Net examples use the html helper Html.DataView_NewDataView() to create the class.

Public $selector .$SelectedRow() - get currently selected row in the model list.

Returns jQuery selector for the row that is currently selected in the model list.

Public bool .IfChanged() - return true if any data fields have been changed.

Returns true if any data fields have been changed.

Internal struct .GetDataFields(classPrefix)

Parameter classPrefix: under construction

Internal void .KeyPress(e, event)

under construction

Internal void .RowClicked(tr) - called when user clicks on a row in the model list.

Parameter tr: tr element user clicked on. under construction

Internal string .SelectRow($tr, checkActiveAjax) - called when user clicks on a row in the model list.

Returns id of model in the row clicked on.

Parameter tr: tr element user clicked on.

Internal void .MarkRowSelected(tr) - Mark row as selected by changing the background color of the row.

Parameter tr: table row element to mark as selected.

Internal string? .BeforeUnloadPage(e) - function is called when user leaves page.

BeforeUnloadPage() is used to display a message to the user when attempting to close the page with unsaved changes.

Parameter e: event, not used.

Internal void .ClearChanged($section) - .

under construction

Internal int/string .GetRowID(tr) - .

under construction

Internal bool .BindExistingModel(id) - .

under construction