EditorWhere Method (String, Object, String) |
Where condition to add to the query used to get data from the database.
Multiple conditions can be added if required.
Can be used in two different ways:
* Simple case: `where( field, value, operator )`
* Complex: `where( fn )`
The simple case is fairly self explanatory, a condition is applied to the
data that looks like `field operator value` (e.g. `name = 'Allan'`). The
complex case allows full control over the query conditions by providing a
closure function that has access to the database Query that Editor is
using, so you can use the `where()`, `or_where()`, `and_where()` and
`where_group()` methods as you require.
Please be very careful when using this method! If an edit made by a user
using Editor removes the row from the where condition, the result is
undefined (since Editor expects the row to still be available, but the
condition removes it from the result set).
Namespace:
DataTables
Assembly:
DataTables (in DataTables.dll) Version: 1.6.5.0 (1.6.5.0)
Syntax public Editor Where(
string key,
Object value,
string op = "="
)
Parameters
- key
- Type: SystemString
Database column name to perform the condition on - value
- Type: SystemObject
Value to use for the condition - op (Optional)
- Type: SystemString
Conditional operator
Return Value
Type:
EditorSelf for chaining
See Also