Ext.NET  5.3.0
.NET Component Framework for Enterprise Level Apps
Ext.Net.JsonWriter Class Reference

Writer that outputs model data in JSON format More...

Inheritance diagram for Ext.Net.JsonWriter:
Ext.Net.AbstractWriter Ext.Net.BaseItem Ext.Net.IAlias Ext.Net.IXObject Ext.Net.IBase

Classes

class  Builder
 
class  Config
 

Public Member Functions

 JsonWriter ()
 
JsonWriter.Builder ToBuilder ()
 
override IControlBuilder ToNativeBuilder ()
 
 JsonWriter (Config config)
 
- Public Member Functions inherited from Ext.Net.BaseItem
virtual bool HasExplicitValue (string name)
 
void EnsureDataBind ()
 
virtual void Call (string name)
 
virtual void Call (string name, params object[] args)
 
virtual void AddScript (string script)
 
virtual void AddScript (string script, params object[] args)
 
virtual bool IsEmptyObject ()
 
Apply< T > (IApply config)
 
BaseItem Apply (object config)
 
virtual void LoadViewState (object state)
 
virtual object SaveViewState ()
 
virtual void TrackViewState ()
 
void SetDirty ()
 
virtual void DataBind ()
 

Static Public Member Functions

static implicit operator JsonWriter (JsonWriter.Config config)
 

Properties

override string InstanceOf [get]
 
override string Type [get]
 Alias More...
 
virtual string RootProperty [get, set]
 The HTTP parameter name by which JSON encoded records will be passed to the server if the encode option is true. More...
 
virtual bool Encode [get, set]
 Configure true to send record data (all record fields if writeAllFields is true) as a JSON encoded HTTP parameter named by the root configuration. The encode option should only be set to true when a root is defined, because the values will be sent as part of the request parameters as opposed to a raw post. The root will be the name of the parameter sent to the server. More...
 
virtual bool AllowSingle [get, set]
 False to ensure that records are always wrapped in an array, even if there is only one record being sent. When there is more than one record, they will always be encoded into an array. Defaults to true. Example: // with allowSingle: true "root": { "first": "Mark", "last": "Corrigan" } More...
 
virtual bool ExpandData [get, set]
 By default, when dot-delimited field mappings are used (e.g. name: 'myProperty', mapping: 'my.nested.property') the writer will simply output a flat data object containing the mapping string literal as the property name (e.g. { 'my.nested.property': 'foo' }). Mappings are used to map incoming nested JSON to flat Ext models. In many case, the data output by the writer should preferrably match the original nested data format. Setting this config to true will ensure that the output will instead look like { my: { nested: { property: 'foo' }}}. The output is generated by getExpandedData, which can optionally be overridden to apply more customized logic. Defaults to: true More...
 
override ConfigOptionsCollection ConfigOptions [get]
 
- Properties inherited from Ext.Net.AbstractWriter
override string InstanceOf [get]
 
abstract string Type [get]
 Alias More...
 
virtual DataOptions?? AllDataOptions [get]
 This object contains the options passed to Ext.data.Model.getData when writing Ext.data.Model.phantom records or when writeAllFields is set to true. NOTE: The serialize option cannot be used here. Defaults to: {persist: true} More...
 
virtual string AllDataOptionsProxy [get]
 A proxy to serialize AllDataOptions More...
 
virtual string NameProperty [get, set]
 This property is used to read the key for each value that will be sent to the server. For example: More...
 
virtual bool WriteAllFields [get, set]
 True to write all fields from the record to the server. If set to false it will only send the fields that were modified. Defaults to false. More...
 
virtual JFunction GetRecordData [get]
 Formats the data for each record before sending it to the server. This method should be overridden to format the data in a way that differs from the default. Parameters record : Object The record that we are writing to the server. Returns An object literal of name/value keys to be written to the server. By default this method returns the data property on the record. More...
 
virtual JFunction FilterRecord [get]
 
virtual JFunction FilterField [get]
 
virtual JFunction Prepare [get]
 
virtual bool ExcludeId [get, set]
 
virtual bool SkipIdForPhantomRecords [get, set]
 
virtual bool SkipPhantomId [get, set]
 
virtual bool HtmlEncode [get, set]
 Configure true to encode html in record data before sending More...
 
virtual string ClientIdProperty [get, set]
 When specified this property causes the Ext.data.Model.idProperty of newly created records to be sent to the server as this name instead of the value of the idProperty. More...
 
virtual string DateFormat [get, set]
 
string PropertyName [get]
 
virtual DataOptions?? PartialDataOptions [get]
 This object contains the options passed to Ext.data.Model.getData when writing non Ext.data.Model.phantom records or when writeAllFields is set to false. NOTE: The serialize option cannot be used here. Defaults to: {changes: true, critical: true} More...
 
virtual string PartialDataOptionsProxy [get]
 A proxy to serialize PartialDataOptions More...
 
virtual TransformFunction Transform [get]
 If a transform function is set, it will be invoked just before writeRecords executes. It is passed the unserialized data object and the request object. The transform function returns a data object, which can be a modified version of the original data object, or a completely new data object. The transform can be a function, or an object with a 'fn' key and an optional 'scope' key. Example usage: Ext.create('Ext.data.Store', { model: 'User', proxy: { type: 'ajax', url : 'users.json', writer: { type: 'json', transform: { fn: function(data, request) { /// do some manipulation of the unserialized data object return data; }, scope: this } } } }); More...
 
virtual string TransformProxy [get]
 A proxy to render .Transform to client More...
 
virtual bool WriteRecordId [get, set]
 By default, each record's id is always included in the output for non-phantom records since in most cases the id will be required on the server to process the record action. This is helpful since the id will normally not be modified, and so would not be sent to the server unless writeAllFields was explicitly enabled. However, there are cases where it is not desirable for the record id to be passed in the data directly. For example, when using a RESTful API the record id would typically be appended to the url instead. Defaults to: true More...
 
override ConfigOptionsCollection ConfigOptions [get]
 
- Properties inherited from Ext.Net.BaseItem
virtual string InstanceOf [get]
 
ItemState State [get]
 
virtual DefaultValueMode DefaultValueMode [get, set]
 
virtual bool DesignMode [get]
 
bool AutoDataBind [get, set]
 
ResourceManager ResourceManager [get]
 
virtual Control Owner [get, set]
 The Owner Control for this Listener. More...
 
virtual bool IsDefault [get]
 Does this object currently represent it's default state. More...
 
bool IsTrackingViewState [get]
 
EventHandlerList Events [get]
 
EventHandler DataBinding
 
Control?? BindingContainer [get]
 
virtual ConfigItemCollection?? CustomConfig [get]
 Collection of custom js config More...
 
virtual ConfigOptionsCollection ConfigOptions [get]
 
virtual ConfigOptionsExtraction ConfigOptionsExtraction [get]
 
System.Web.Mvc.HtmlHelper?? HtmlHelper [get, set]
 
- Properties inherited from Ext.Net.IXObject
ConfigOptionsCollection ConfigOptions [get]
 
ConfigOptionsExtraction ConfigOptionsExtraction [get]
 
DefaultValueMode DefaultValueMode [get, set]
 
- Properties inherited from Ext.Net.IAlias
string PropertyName [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Ext.Net.BaseItem
 BaseItem (Control owner)
 
 BaseItem ()
 
virtual void OwnerUpdate (Control owner)
 
virtual void OnDataBinding (EventArgs e)
 

Detailed Description

Writer that outputs model data in JSON format

Constructor & Destructor Documentation

◆ JsonWriter() [1/2]

Ext.Net.JsonWriter.JsonWriter ( )
inline

◆ JsonWriter() [2/2]

Ext.Net.JsonWriter.JsonWriter ( Config  config)
inline

Member Function Documentation

◆ operator JsonWriter()

static implicit Ext.Net.JsonWriter.operator JsonWriter ( JsonWriter.Config  config)
inlinestatic

◆ ToBuilder()

JsonWriter.Builder Ext.Net.JsonWriter.ToBuilder ( )
inline

◆ ToNativeBuilder()

override IControlBuilder Ext.Net.JsonWriter.ToNativeBuilder ( )
inlinevirtual

Reimplemented from Ext.Net.BaseItem.

Property Documentation

◆ AllowSingle

virtual bool Ext.Net.JsonWriter.AllowSingle
getset

False to ensure that records are always wrapped in an array, even if there is only one record being sent. When there is more than one record, they will always be encoded into an array. Defaults to true. Example: // with allowSingle: true "root": { "first": "Mark", "last": "Corrigan" }

// with allowSingle: false "root": [{ "first": "Mark", "last": "Corrigan" }]

◆ ConfigOptions

override ConfigOptionsCollection Ext.Net.JsonWriter.ConfigOptions
get

◆ Encode

virtual bool Ext.Net.JsonWriter.Encode
getset

Configure true to send record data (all record fields if writeAllFields is true) as a JSON encoded HTTP parameter named by the root configuration. The encode option should only be set to true when a root is defined, because the values will be sent as part of the request parameters as opposed to a raw post. The root will be the name of the parameter sent to the server.

◆ ExpandData

virtual bool Ext.Net.JsonWriter.ExpandData
getset

By default, when dot-delimited field mappings are used (e.g. name: 'myProperty', mapping: 'my.nested.property') the writer will simply output a flat data object containing the mapping string literal as the property name (e.g. { 'my.nested.property': 'foo' }). Mappings are used to map incoming nested JSON to flat Ext models. In many case, the data output by the writer should preferrably match the original nested data format. Setting this config to true will ensure that the output will instead look like { my: { nested: { property: 'foo' }}}. The output is generated by getExpandedData, which can optionally be overridden to apply more customized logic. Defaults to: true

◆ InstanceOf

override string Ext.Net.JsonWriter.InstanceOf
get

◆ RootProperty

virtual string Ext.Net.JsonWriter.RootProperty
getset

The HTTP parameter name by which JSON encoded records will be passed to the server if the encode option is true.

◆ Type

override string Ext.Net.JsonWriter.Type
getprotected

Alias


The documentation for this class was generated from the following files: