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. Image for the cookie policy date

how to validate only after focus

i want to grid have a default row when first time created. But then dialog of validate "Item code is required" show. I want this only show after i focus on. Please help me.  


3 Replies

JC Joseph Christ Nithin Issack Syncfusion Team March 13, 2023 07:52 PM UTC

Hi Tuan,


  Greetings from Syncfusion support.


   Before proceeding with the solution, we would like you to share the below details.


  • Explain your requirement in detail.
  • Complete grid rendering code.
  • Simple sample you are using.
  • Video demo explaining your requirement.
  • Syncfusion package version.


Regards,

Joseph I.




RR Rajapandi Ravi Syncfusion Team November 30, 2023 06:58 AM UTC

Ali,


After reviewing your query, we could see that, while adding a row the Item code validating message is displayed in initial. Based on your requirement we have prepared a sample of Grid with Command column and tried to reproduce your reported problem, but it was unsuccessful.


In this below sample, while adding a record the OrderID is focused, and the validation message is displayed after we move the focus to another element. Please refer the below sample for more information.


Sample: https://stackblitz.com/edit/react-6bfxmu-z1az3f?file=index.js


We would like to inform you that, by default the validation message is displayed when we focus out the element. It was the default behavior. In your shared code example, we could see that you are manually invoking and addRecord() method and like to set the focus manually to the targeted column. In your code example, you have calling your custom function setInputFocus(). So, we suspect in that function you have invoked the blur for the input element. While invoking blur() the focused input element gets focus out at this time the validating message was displayed. It was the default behavior.


So please ensure you have invoking blur inside your setInputFocus() method or not. If you still face any issue, please share the below details that would be helpful for us to provide better solution.


1)                  Share your exact requirement scenario with detailed description.


2)                  Share your use case scenario.


3)                  Please share the issue scenario in video demonstration format.


4)                  Share your Syncfusion package version.


5)                  Share your complete Grid rendering code, we would like to check what action you are performing inside your setInputFocus() method.


Loader.
Live Chat Icon For mobile
Up arrow icon