We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Restrict Character Limit for Task Name

Thread ID:

Created:

Updated:

Platform:

Replies:

132001 Aug 8,2017 06:09 AM UTC Aug 10,2017 09:52 AM UTC ASP.NET MVC 3
loading
Tags: Gantt
Kuntal Patel
Asked On August 8, 2017 06:09 AM UTC

Hi,

Need your help on priority bases. As we are working on commited delivery,I would like to know how can I put character limit for Task Name.

e.g.If we have Task Name character limit like 30 so user can not add more than 30 character into Task Name.

if User can paste more than 30 character than user can not paste more than 30 character.

Is there any property or some other way available in Gantt control ? Awaiting your prompt response in this regard.


Attachment: Allowcharacter_cef2c78.zip

Suriyaprasanth Ravikumar [Syncfusion]
Replied On August 9, 2017 09:46 AM UTC

Hi Kuntal 
 
We have prepared a sample and achieved your requirement by using “BeginEdit” and “ActionBegin” client side event. 
We can set maximum length of characters for input box by using “maxlength” attribute. While cell editing and dialog add/edit action we can set maxlength attribute for input element of task name field 
using “BeginEdit” and “ActionBegin” events.  
 
Please refer the following code snippets. 
[CSHTML] 
<body> 
    @(Html.EJ().Gantt("GanttContainer") 
         //.. 
             .ClientSideEvents(cs => 
                            { 
                                cs.BeginEdit("BeginEdit"); 
                                cs.ActionBegin("ActionBegin"); 
                            }) 
        //.. 
) 
@(Html.EJ().ScriptManager()) 
    <script type="text/javascript"> 
//Event trigger at the cell edit 
        function BeginEdit(args) { 
            if (args.columnIndex == 1) { 
                $(args.cellElement).focusin(function (arg) { 
                    $("#" + arg.target.id).attr('maxlength', '15'); 
                }); 
            } 
        } 
 
        //Event trigger at the dialog edit 
        function ActionBegin(args) { 
            if (args.requestType == "beforeOpenEditDialog") { 
                $("#GanttContainertaskNameEdit").attr('maxlength', '15'); // GanttContainer is id of Gantt control 
            } 
        } 
    </script> 
 
Please find the sample from following location. 
 
Thanks, 
Suriyaprasanth R. 



Kuntal Patel
Replied On August 9, 2017 10:56 AM UTC

Thanks it's working fine.

can you please give us references URL from where we can find this kind of solution with example.



Suriyaprasanth Ravikumar [Syncfusion]
Replied On August 10, 2017 09:52 AM UTC

Hi Kuntal, 
 
Thanks for your update. 
Currently we are documented the solution for generic features and workarounds available in Gantt, for user specific requirement we will provide solution by forum and support incidents. 
 
Please refer the following link to know more about Gantt control. 
 
Please refer the below link to get details about available properties, methods and client side events in Gantt. 
 
Please let us know if you need any other assistance.  
 
Regards,  
Suriyaprasanth R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;