Show / Hide Table of Contents

Namespace DataTables

Classes

Database

DataTables Database connection object.

Create a database connection which may then have queries performed upon it.

This is a database abstraction class that can be used on multiple different databases. As a result of this, it might not be suitable to perform complex queries through this interface or vendor specific queries, but everything required for basic database interaction is provided through the abstracted methods.

DtRequest

Representation of a DataTables or Editor request. This can be any form of request from the two libraries, including a standard DataTables get, a server-side processing request, or an Editor create, edit or delete command.

DtRequest.ColumnT

Column class for server-side processing nested data

DtRequest.OrderT

Order class for server-side processing nested data

DtRequest.SearchPanesOptions

Options for SearchPanes submitted by the client-side

DtRequest.SearchT

Search class for server-side processing nested data

DtResponse

DataTables and Editor response object. This object can be used to construct and contain the data in response to a DataTables or Editor request before JSON encoding it and sending to the client-side.

Note that this object uses lowercase property names as this it output directly to JSON, so the format and parameter names that DataTables and Editor expect must be used.

DtResponse.FieldError

Editor field error nested class. Describes an error message for a field if it is in an error state.

DtResponse.ResponseUpload

Upload response information

Editor

DataTables Editor base class for creating editable tables.

Editor class instances are capable of servicing all of the requests that DataTables and Editor will make from the client-side - specifically:

  • Get data
  • Create new record
  • Edit existing record
  • Delete existing records

The Editor instance is configured with information regarding the database table fields that you which to make editable, and other information needed to read and write to the database (table name for example!).

This documentation is very much focused on describing the API presented by these DataTables Editor classes. For a more general overview of how the Editor class is used, and how to install Editor on your server, please refer to the Editor manual ( https://editor.datatables.net/manual ).

EditorGetAttribute

Get attribute

EditorHttpNameAttribute

Define the HTTP name (used for both the JSON and incoming HTTP values on form submit) for the field defined by the parameter. The parameter name is used as the database column name automatically.

EditorIgnoreAttribute

Tell Editor to not use this property from the model as part of the data to process (fetch from the database, or expect from the client-side)

EditorModel

This base class is used to extend models used in the 'Model()' method for the Editor class.

Currently it doesn't actually do anything, but there is a chance it will in future, so this is just for future compatibility

EditorSetAttribute

Set attribute

EditorTypeErrorAttribute

Define an error message for cases where the data given cannot be stored in parameter type.

Field

Field definitions for the DataTables Editor.

Each Database column that is used with Editor can be described with this Field method (both for Editor and Join instances). It basically tells Editor what table column to use, how to format the data and if you want to read and/or write this column.

Format

Formatter methods for the DataTables Editor. All of the methods in this class return a delegate that can be used in the

GetFormatter
and
SetFormatter
methods of the
Field
class.

Each method may define its own parameters that configure how the formatter operates. For example the date / time formatters take information on the formatting to be used.

MJoin

The MJoin class provides a one-to-many join link for Editor. This can be useful in cases were an attribute can take multiple values at the same time - for example cumulative security access levels.

Typically the MJoin class should be used with a link table, but this is optional. Please note that if you don't use a link table you should be aware that on edit the linked rows are deleted and then reinserted, thus if any values should be retained they should also be submitted.

Please refer to the Editor .NET documentation for further information https://editor.datatables.net/manual/net

Options

The Options class provides a convenient method of specifying where Editor should get the list of options for a select, radio or checkbox field. This is normally from a table that is left joined to the main table being edited, and a list of the values available from the joined table is shown to the end user to let them select from.

Options instances are used with the Field.Options() method.

PostCreateEventArgs

Arguments for the 'PostCreate' Editor event

PostEditEventArgs

Arguments for the 'PostEdit' event

PostGetEventArgs

Arguments for the 'PostGet' Editor event

PostRemoveEventArgs

Arguments for the 'PostRemove' Editor event

PostUploadEventArgs

Arguments for the 'PostUpload' Editor event

PreCreateEventArgs

Arguments for the 'PreCreate' Editor event

PreEditEventArgs

Arguments for the 'PreEdit' Editor event

PreGetEventArgs

Arguments for the 'PreGet' Editor event

PreRemoveEventArgs

Arguments for the 'PreRemove' Editor event

PreUploadEventArgs

Arguments for the 'PreUpload' Editor event

Query

The Query class provides methods to craft an individual query against the database.

The typical pattern for using this class is through the 'Database'. Typically it would not be initialised directly.

Note that this is a stub class that a driver will extend and complete as required for individual database types. Individual drivers could add additional methods, but this is discouraged to ensure that the API is the same for all database types.

Result

Result object given by a

Query
performed on a database.

The typical pattern for using this class is to receive an instance of it as a result of using the

Database
and
Query
class methods that return a result. This class should not be initialised independently.

Note that this is a stub class that a driver will extend and complete as required for individual database types. Individual drivers could add additional methods, but this is discouraged to ensure that the API is the same for all database types.

SearchBuilderDetails

SearchBuilderOptions

The SearchBuilderOptions class provides a convenient method of specifying where Editor should get the list of options for SearchBuilder options list. This is normally from a table that is left joined to the main table being edited, and a list of the values available from the joined table is shown to the end user to let them select from.

SearchBuilderOptions instances are used with the Field.SearchBuilderOptions() method.

SearchPaneOptions

The SearchPaneOptions class provides a convenient method of specifying where Editor should get the list of options for SearchPanes options list. This is normally from a table that is left joined to the main table being edited, and a list of the values available from the joined table is shown to the end user to let them select from.

SearchPanesOptions instances are used with the Field.SearchPaneOptions() method.

Upload

Upload class for Editor. This class provides the ability to easily specify file upload information, specifically how the file should be recorded on the server (database and file system).

An instance of this class is attached to a field using the 'Field.upload()' method. When Editor detects a file upload for that file the information provided for this instance is executed.

The configuration is primarily driven through the 'db' and 'action' methods

ValidatedCreateEventArgs

Arguments for the 'ValidatedCreate' Editor event

ValidatedEditEventArgs

Arguments for the 'ValidatedEdit' Editor event

Validation

Validation methods for DataTables Editor fields. All of the methods defined in this class return a delegate that can be used by

Field
instance's
Validator
method.

Each method may define its own parameters that configure how the formatter operates. For example the minLen validator takes information on the minimum length of value to accept.

Additionally each method can optionally take a

ValidationOpts
instance that controls common validation options and error messages.

The validation delegates return null for validate data and a string for invalid data, with the string being the error message.

ValidationOpts

Common validation options that can be specified for all validation methods.

WriteCreateEventArgs

Arguments for the 'WriteCreate' Editor event

WriteEditEventArgs

Arguments for the 'WriteEdit' Editor event

Enums

DtRequest.RequestTypes

Request type values

Field.SetType

Set options for the

Set()
method, controlling when this field's value is set on the database

Upload.DbType

Database upload options for the 'fields' option in the 'Db()' method. These are used to provide easy information about the file that will be stored in the database.

In This Article
Back to top Generated by DocFX