Articles in this section
Category / Section

What are the available editors in JavaScript Gantt columns?

2 mins read

Besides default columns generated by the JavaScript Gantt control, a user can also add custom columns with the below edit types, using load client side event.

The list of editors available in Gantt for custom columns are:

  1. String
  2. Numeric
  3. Drop down
  4. Boolean
  5. Currency
  6. Percentage
  7. Mask Edit

Please refer the below code snippets for more details.

<body>
    <div id="Gantt" style="position: absolute;"></div>
    <script type="text/javascript">
      $(function () {
        $("#Gantt").ejGantt({
            //...
            load: load
        });
    });
           //Sample Data for dropdown box
           var dropDownData = [
                   { text: "Open", value: "Open" },
                   { text: "Progress", value: "Progress" },
                   { text: "Testing", value: "Testing" },
                   { text: "Completed", value: "Completed" }];
           function load(args) {
                var columns = this.getColumns();
                //Checkbox column with boolean edit 
                columns.push(
                    {
                        field: "State",
                        headerText: "State",
                        editType: "booleanedit",
                        mappingName: "State",
                        width: "180px",
                    });
                //Column with drop down list 
                columns.push(
                    {
                        field: "TaskStatus",
                        headerText: "Task Status",
                        editType: "dropdownedit",
                        mappingName: "TaskStatus",
                        dropdownData: dropDownData,
                        width: "180px",
                    });
                //Column with String text box
                columns.push(
                    {
                        field: "Description",
                        headerText: "Description",
                        editType: "stringedit",
                        mappingName: "Description",
                        width: "180px",
                    });
                //Column with Numeric textbox
                columns.push(
                {
                    field: "Value",
                    headerText: "Value",
                    editType: "numericedit",
                    mappingName: "Value",
                    width: "180px",
                });
                //Column with NumericEdit currency textbox
                columns.push(
                {
                    field: "Amount",
                    headerText: "Total",
                    editType: "numericedit",
                    mappingName: "Amount",
                    width: "180px",
                    format: "{0:C2}"
                });
                //column with NumericEdit percentage textbox
                columns.push(
                    {
                        field: "Percentage",
                        headerText: "Percentage",
                        editType: "numericedit",
                        mappingName: "Percentage",
                        width: "180px",
                        format: "{0:P0}",
                        editParams: { decimalPlaces: 2, incrementStep: 0.01 }
                    });
                //column with mask edit textbox
                columns.push(
                    {
                        field: "MaskedColumn",
                        headerText: "Masked Text",
                        editType: "maskedit",
                        mappingName: "MaskedColumn",
                        width: "180px",
                        editParams: { maskFormat: "9999" }
                    });
            }           
        </script>
</body>      

Sample link

A sample for updating the dimensions of Gantt chart is available in the following link. Sample

Conclusion

I hope you enjoyed learning about the available editors in JavaScript Gantt columns.

You can refer to our  JavaScirpt GanttChart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied