New to Kendo UI for jQuery? Start a free 30-day trial

Define

methods

Defines a new GanttTask type using the provided options.

Parameters:optionsObject

Describes the configuration options of the new Gantt task class.

options.idString

The name of the field which acts as an identifier of the Gantt task. The identifier is used to determine if a model instance is new or existing. If the value of the field specified is equal to the default value (specified through the fields configuration), the model is considered as new.

options.fieldsObject

A set of key/value pairs the configure the model fields. The key specifies the name of the field. Quote the key if it contains spaces or other symbols which are not valid for a JavaScript identifier.

options.fields.fieldName.editableBoolean

Specifies the value which will be used for the field when a new model instance is created. The default settings depend on the type of the field.

The default for:

  • "string" is "".
  • "number" is 0.
  • "date" is new Date() (today).
options.fields.fieldName.nullableBoolean

Specifies if the field is editable or not. Defaults to true.

options.fields.fieldName.parseFunction

Specifies if the defaultValue setting should be used. Defaults to false.

options.fields.fieldName.typeString

Specifies the function which will parse the field value. If not set, the default parsers will be used.

options.fields.fieldName.validationObject

Specifies the type of the field.

The available options are:

  • (Default) "string"
  • "number"
  • "boolean"
  • "date"
js
var Task = kendo.data.GanttTask.define({
    id: "id",
    fields: {
        id: { from: "ID", type: "number" },
        orderId: { from: "OrderID", type: "number", validation: { required: true } },
        parentId: { from: "ParentID", type: "number", nullable: true },
        start: { from: "Start", type: "date" },
        end: { from: "End", type: "date" },
        title: { from: "Title", defaultValue: "", type: "string" },
        percentComplete: { from: "PercentComplete", type: "number" },
        summary: { from: "Summary" },
        expanded: { from: "Expanded" }
    }
});
Not finding the help you need?
Contact Support