1. Tag Results
column-with-checkbox (3)
1 - 3 of 3
How to add custom column with check box in .NET WebForms Gantt Chart?
In Gantt, user can display checkbox column by using load client side event and column template support. The below code snippet explains initializing a custom column with checkbox and saving the editing changes to the data source. Code snippets: <form id="form1" runat="server" onsubmit="return false" style="overflow: hidden; padding:0; margin: 0;height:100%;width:100%;"> <ej:Gantt ID="Gantt" runat="server" AllowSelection="true" //... Load="Load" BeginEdit="BeginEdit">   </ej:Gantt>   <script type="text/x-jsrender" id="customColumnTemplate"> <div style="margin-left:20px;"> {{if State}} <input class="customCheckbox" type="checkbox" checked="checked" value="" /> {{else}} <input class="customCheckbox" type="checkbox" value="" /> {{/if}} </div> </script>   <script> function Load() { var columns = this.getColumns(); columns.splice(4, 0, { field: "State", headerText: "State", isTemplateColumn: true, templateID: "customColumnTemplate", width: "80px", }); }   // To prevent the string edit while editing check box function BeginEdit(args) {   var columnIndex = args.columnIndex; if (columnIndex == 4) { args.cancel = true; } }   //Get checked row and select or unselect corresponding records $("#Gantt").on("change", ".customCheckbox", function (e) { var $tr = $(e.target).closest('tr'), ganttObj = $("#Gantt").data("ejGantt"), checkStatus = $(e.target).is(':checked'), $gridRows = ganttObj.getRows(), rowIndex = $gridRows.index($tr), record = ganttObj.model.currentViewData &&    ganttObj.model.currentViewData[rowIndex]; record["state"] = checkStatus; }); </script> The following output is displayed for the above code example. Sample link A sample to add custom column with check box is available in the following Sample linkNoteA new version of Essential Studio for ASP.NET is available. Versions prior to the release of Essential Studio 2014, Volume 2 will now be referred to as a classic versions.The new ASP.NET suite is powered by Essential Studio for JavaScript providing client-side rendering of HTML 5-JavaScript controls, offering better performance, and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.The Classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential Studio for ASP.NET. Although Syncfusion will continue to support all Classic Versions, we are happy to assist you in migrating to the newest edition.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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!
How to add custom column with check box in .NET MVC Gantt ?
https://www.syncfusion.com/aspnet-mvc-ui-controls/gantt-chartIn Gantt, user can display checkbox column by using load client side event and column template support. The below code snippet explains initializing a custom column with checkbox and saving the editing changes to the data source. Code snippets: <script type="text/x-jsrender" id="customColumnTemplate">   <div style="margin-left:20px;"> {{if State}} <input class="customCheckbox" type="checkbox" checked="checked" value="" /> {{else}} <input class="customCheckbox" type="checkbox" value="" /> {{/if}} </div>   </script>   @(Html.EJ().Gantt("Gantt"). //... ClientSideEvents(eve=> { eve.Load("Load"); eve.BeginEdit("BeginEdit"); }). .Datasource(ViewBag.dataSource) ) @(Html.EJ().ScriptManager())   <script> function Load(args) { var columns = this.getColumns(); columns.splice(4, 0, { field: "State", headerText: "State", isTemplateColumn: true, templateID: "customColumnTemplate", width: "80px", }); }          // To prevent the string edit while editing check box function BeginEdit(args) {           var columnIndex = args.columnIndex; if (columnIndex == 4) { args.cancel = true; } } //Get checked row and select or unselect corresponding records $("#Gantt").on("change", ".customCheckbox", function (e) { var $tr = $(e.target).closest('tr'), ganttObj = $("#Gantt").data("ejGantt"), checkStatus = $(e.target).is(':checked'), $gridRows = ganttObj.getRows(), rowIndex = $gridRows.index($tr), record = ganttObj.model.currentViewData &&    ganttObj.model.currentViewData[rowIndex]; record["state"] = checkStatus; }); </script> </body>   The following output is displayed for the above code example. Sample link A sample to add Custom columns with checkbox is available in the following sample linkConclusion I hope you enjoyed learning about how to add custom column with check box in .NET MVC Gantt.You can refer to our .NET MVC Gantt 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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!
How to add custom column with check box in JavaScirpt GanttChart ?
In Gantt, user can display checkbox column by using load client side event and column template support. The below code snippet explains initializing a custom column with checkbox and saving the editing changes to the data source. Code snippets: <body> <div id="gantt"></div>  <script type="text/x-jsrender" id="customColumnTemplate"> <div style="margin-left:20px;">{{if State}} <input class="customCheckbox" type="checkbox" checked="checked" value="" />{{else}} <input class="customCheckbox" type="checkbox" value="" />{{/if}}</div> </script> <script>         var projectData = [{             taskID: 1,             taskName: "Planning",             startDate: "02/03/2014",             endDate: "02/07/2014",             progress: 100,             duration: 5,             state: true,             subtasks: [{                 taskID: 2,                 taskName: "Plan timeline",                 startDate: "02/03/2014",                 endDate: "02/07/2014",                 duration: 5,                 state: true,                 progress 100             },                 //...             ]         }];         $(function() {             $("#gantt").ejGantt({                 dataSource: projectData,                 //...                 beginEdit: beginEdit,                 load: function() {                     var columns = this.getColumns();                     columns.splice(4, 0, {                         field: "state",                         headerText: "State",                         isTemplateColumn: true,                         templateID: "customColumnTemplate",                         width: "80px",                     });                 }               });         });         // To prevent the string edit while editing check box         function beginEdit(args) {                       var columnIndex = args.columnIndex;             if (columnIndex == 4) {                 args.cancel = true;             }         }         //Get checked row and select or unselect corresponding records         $("#gantt").on("change", ".customCheckbox", function (e) {                 var $tr = $(e.target).closest('tr'),                     ganttObj = $("#gantt").data("ejGantt"),                     checkStatus = $(e.target).is(':checked'),                     $gridRows = ganttObj.getRows(),                     rowIndex = $gridRows.index($tr),                     record = ganttObj.model.currentViewData &&                                 ganttObj.model.currentViewData[rowIndex];                     record["state"] = checkStatus;        });     </script>  </body>   The below screen shot depicts the above code example Sample link A sample to add custom column with checkbox is available in the following link, SampleConclusion I hope you enjoyed learning about how to add custom column with check box in JavaScirpt GanttChart.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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!
No articles found
No articles found
1 of 1 pages (3 items)