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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Validation numeric text box

Thread ID:

Created:

Updated:

Platform:

Replies:

149551 Nov 29,2019 01:40 PM UTC Dec 30,2019 11:32 AM UTC Vue 13
loading
Tags: Gantt Chart
Tomasz Tomczykiewicz
Asked On November 29, 2019 01:40 PM UTC

Hi,

I have two columns: start and end. Both are numeric and I can edit them in cell mode. If in the start cell I have value 10 I want to disable values smaller than 10 in end cell. How can I achieve this?

Best regards,
Tomasz Tomczykiewicz

Pooja Priya Krishna Moorthy [Syncfusion]
Replied On December 2, 2019 11:59 AM UTC

Hi Tomasz, 
We can achieve your requirement, by using edit.params in Gantt column property to handle numericTextBox model . When click on the end cell, using focus event of NumericTextBox we are validate and set the min value of start cell value. Hence, we can’t change less than start value. 

Please find the below code example. 
 
 
<ejs-gantt 
   //... 
   :columns= "columns" 
></ejs-gantt> 
  data: function() { 
    return { 
      //... 
      columns: [ 
        //... 
         { field: 'Custom2',width: 100, 
          edit: { 
              params: { value: 0, 
                focus: function(args){ 
                  var ganttobj = document.getElementById('GanttContainer').ej2_instances[0]; 
                  var index = ganttobj.selectedRowIndex; 
                  if(ganttobj.flatData[index].Custom1){ 
                      this.min = ganttobj.flatData[index].Custom1 
                  }           
                } 
              } 
           }, editType: 'numericedit' },        
      ], 
    }; 
  } 
 
Please find the below sample link. 
 
Regards, 
Pooja Priya K. 


Tomasz Tomczykiewicz
Replied On December 2, 2019 01:21 PM UTC

Hi,

Thanks, it's solved my problem.

Best regards,
Tomasz Tomczykiewicz

Jonesherine Stephen [Syncfusion]
Replied On December 3, 2019 07:28 AM UTC

Hi Tomasz, 
Thanks for your update. 
We are happy that issue has been resolved at your end. 
Please let us know if you need further assistance on this. 
 
Regards, 
Jone sherine P S 


Tomasz Tomczykiewicz
Replied On December 10, 2019 10:21 AM UTC

Hi,

I have an issue with this validation. In start cell I have value 10. I inline edit the end cell value to 5 and press enter, the validation doesn't work. But when I click outside the cell, the validation works.

Best regards,
Tomasz Tomczykiewicz

Tomasz Tomczykiewicz
Replied On December 10, 2019 11:05 AM UTC

Additionally, when I leave empty value after editing I have NaN (instead of null).

Pooja Priya Krishna Moorthy [Syncfusion]
Replied On December 12, 2019 09:30 AM UTC

Hi Tomasz, 
Please find the below response. 
S.No 
Query 
Syncfusion Comments 
 
1 
 
 
I have an issue with this validation. In start cell I have value 10. I inline edit the end cell value to 5 and press enter, the validation doesn't work. But when I click outside the cell, the validation works. 
 
 
We can resolve this by setting the value of start cell to validation.min value in the focus event of NumericTextBox control as like below code example. 
 
 
return 
      //...  
      columns: [  
        //...  
      { 
            field: 'Custom2', width: 100, 
            validationRules: { required: true, number: true }, 
            edit: { 
                params: { 
                focus: function (args) { 
                        var ganttobj = document.getElementById('GanttContainer').ej2_instances[0]; 
                        var index = ganttobj.selectedRowIndex; 
                        var minValue = ganttobj.flatData[index].Custom1; 
                       ganttobj.ganttColumns[2].validationRules.min = minValue; 
                    } 
                } 
            }, editType: 'numericedit' 
        },       
   ],  
};  
 
 
 
 
2 
 
 
when I leave empty value after editing I have NaN (instead of null). 
 
We suggest you to use validation required set to true. So that it prevents you from saving empty value. 
 
  
    return 
      //...  
      columns: [  
        //...  
        { 
            field: 'Custom1', validationRules: { required: true, number: true },        
        }, 
      ],  
    };  
 
 
 
Please get back to us if you require further assistance on this. 
 
Regards, 
Pooja K. 
 
 


Tomasz Tomczykiewicz
Replied On December 12, 2019 11:13 AM UTC

Hi,

Thanks for replay, it solved my first problem. But for the second problem, we misunderstood each other. User can leave empty value- I don't want to block this option. Only problem is, when the user leaves empty value it is NaN.


Best regards,
Tomasz Tomczykiewicz

Pooja Priya Krishna Moorthy [Syncfusion]
Replied On December 13, 2019 04:11 PM UTC

Hi Tomasz, 
We can resolve this by setting the type of column as number in the column definition. Please find the below code example. 
  
    return 
      //...  
      columns: [  
        //...  
        { 
            field: 'Custom1', type:”number”},        
        }, 
      ],  
    };  

Regards, 
Pooja Priya K. 
 


Tomasz Tomczykiewicz
Replied On December 16, 2019 09:24 AM UTC

Hi,

Your provided solution doesn't resolve my problem. I can't delete a value, it returns to the previous value (see attached gif).

Best regards,
Tomasz Tomczykiewicz


Attachment: Kapture_20191216_at_10.21.02.gif_c94b3c45.zip

Pooja Priya Krishna Moorthy [Syncfusion]
Replied On December 17, 2019 01:01 PM UTC

Hi Tomasz, 

We are also able to reproduce the issue, when allowUnscheduledTasks property is disabled. We logged a bug report for this. You can track its status from below feedback link. 
We will fix this issue and include in our weekly patch release which is expected to be rolled out on January 2, 2020. 
Until then we appreciate your patience. 

Thanks, 
Pooja K 


Pooja Priya Krishna Moorthy [Syncfusion]
Replied On December 24, 2019 01:54 PM UTC

Hi Tomasz, 
Thanks for your patience. 
We have fixed the reported issue. Please find the release notes from below link. 
Please upgrade your Gantt packages to the highest version v17.4.40. We have prepared a sample with latest source, please find the sample from below link. 

Regards, 
Pooja K. 


Tomasz Tomczykiewicz
Replied On December 27, 2019 10:31 AM UTC

Hi,

Thanks, it's solved my problem.

Best regards,
Tomasz Tomczykiewicz

Karthikeyan Raja [Syncfusion]
Replied On December 30, 2019 11:32 AM UTC

Hi Tomasz, 
  
Most welcome. We are happy that your issue has been resolved. Please get back to us if you need any assistance on this. 
  
Regards, 
Karthikeyan Raja. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon