Skip to main content
All docs
V19.1

GanttSettings.CustomJSProperties Property

Enables you to supply any server data that can then be parsed on the client.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.1.dll

Declaration

public TreeListCustomJSPropertiesEventHandler CustomJSProperties { get; set; }

Property Value

Type Description
TreeListCustomJSPropertiesEventHandler

A delegate method allowing you to implement custom processing.

Remarks

In some instances, it is necessary to obtain server information on the client. The delegate method defined by the CustomJSProperties property enables you to declare temporary client properties. Once declared, a property can be accessed on the client.

To add new properties, use the parameter’s Properties property, which represents a collection of property names and their values. The only requirement is that property names must begin with the ‘cp’ prefix, to avoid rewriting the base properties exposed by the GanttSettings.

settings.CustomJSProperties = (sender, e) => {
    // Scalar value
    e.Properties["cpScalar"] = "my value";

    // Nested arrays
    e.Properties["cpNestedArrays"] = new object[] { 
        "value",
        null,
        new string[] { "name1", "name2" }};

    // Hashtable 
    Hashtable hash = new Hashtable();
    hash.Add("key", "value");
    e.Properties["cpHash"] = hash;
};

settings.DataBound = (sender, e) => {
    MVCxGantt gantt = sender as MVCxGantt;
    gantt.JSProperties["cp_Param1"] = "my value";
};
See Also