Hi
1. I want to add validation in task Editor for custom Fields with custom message.
2. How can i add custom fields above Dates data sets.
3. How can show the values of fields when retrieved from DB
Support Forum
Listen to Gnt.widget.taskeditor.TaskEditor#validate event and add your custom validation there.rahulranjan wrote: ↑Tue Aug 06, 2019 11:52 am Hi
1. I want to add validation in task Editor for custom Fields with custom message.
Gnt.widget.taskeditor.TaskEditor docs introduction has "Extending the General field set" chapter which demonstrates adding a field to the "General" tab. The only thing it appends a custom field ..and you want to insert it.
To achieve what you want use insert method instead of add. Something like that:
// extend standard TaskForm class
Ext.define('MyTaskForm', {
extend : 'Gnt.widget.taskeditor.TaskForm',
constructor : function(config) {
this.callParent(arguments);
// insert some custom field at index 2
this.insert(2, {
fieldLabel : 'Foo',
name : 'Name',
width : 200
});
}
});
// Let task editor know which class to use
Ext.create('Gnt.widget.taskeditor.TaskEditor', {
// to use MyTaskForm to build the "General" tab
taskFormClass : 'MyTaskForm'
});
All model fields are automatically filled with data ..as soon as values of "name" config of the form fields match their model field names.rahulranjan wrote: ↑Tue Aug 06, 2019 11:52 am 3. How can show the values of fields when retrieved from DB
Hi
I didn't get it
Q1.
This is the extra custom field in Task Editor
I want some validation in it like it can not be more than 100 or less than 0
Default value should be 0 . Custom error message. if enter more than 100 or less than 0 .
If validation fails then save button should be disabled.
Q2. I want to load values from DB as drop down in below filed which opening the Task editor
Default selected value will be the first one of drop down. if any values is selected and saved then that value should be show as selected
I didn't get it
Q1.
This is the extra custom field in Task Editor
{
type: "textfield",
ref: "plannedScopeField",
name: "plannedScope",
label: "planned Scope ",
flex: "1 0 50%",
cls: "b-inline"
},
Default value should be 0 . Custom error message. if enter more than 100 or less than 0 .
If validation fails then save button should be disabled.
Q2. I want to load values from DB as drop down in below filed which opening the Task editor
{
type: "textfield",
ref: "uomField",
name: "uom",
label: "UOM",
flex: "1 0 50%",
cls: "b-inline"
},
In the first case please use numberfield instead of textfield. See min/max configs.
In the second case please use combo. Load data to the store which is used in this combo in advance.
Default data in both cases should be applied to your record when it's created (see defaultValue in Model definition) and before task editing begins.
In the second case please use combo. Load data to the store which is used in this combo in advance.
Default data in both cases should be applied to your record when it's created (see defaultValue in Model definition) and before task editing begins.
Pavlo Miklashevych
Sr. Frontend Developer
Please look at this docs: https://www.bryntum.com/docs/scheduler/#Common/widget/Combo
Please pay attention to its type. It's "combo": Also please pay attention to the code snippets in the docs. It has a number of examples which show how combo can be configured. items or store should be used to specify options.
Also you can check out examples/eventeditor/app.js to see how we configure combo in Event Editor demo:
Please pay attention to its type. It's "combo": Also please pay attention to the code snippets in the docs. It has a number of examples which show how combo can be configured. items or store should be used to specify options.
Also you can check out examples/eventeditor/app.js to see how we configure combo in Event Editor demo:
....}, {
type : 'combo',
name : 'eventType',
label : 'Type',
index : 2,
items : ['Appointment', 'Internal', 'Meeting']
}, {...
Pavlo Miklashevych
Sr. Frontend Developer