jQuery UI Widgets › Forums › Grid › Date column is getting set to current date on pasting string
Tagged: #jqxdatetimeinput, Angular, copypaste, jqxGrid ;
This topic contains 5 replies, has 2 voices, and was last updated by Martin 7 years, 5 months ago.
-
Author
-
Hi ,
I have a grid with columns in date format . User can copy paste & inline edit in the grid. When the user accidentally pastes a string instead of date in a date column, the value gets reset to current date. How to stop this behaviour or show some sort of error message ?I have included the link to one of your demos
https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm#demos/jqxgrid/dataexport.htmIf you accidentally copy paste first or last name to ship Date , instead of throwing an error it defaults to current date .How to stop this behaviour & show error message ?
Hello Debaditya,
There is no way to add validation for copy/paste between cells.
You can either stop the whole functionality by setting theclipboardproperty to “false”,
or you can use thecellvaluechangedevent to check the old and new values and return the old one, if needed.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/1. Cellvalue changing does not get triggered on copy paste
2.what if the user is pasting multiple rows together, for one column data mismatch… I will cancel the entire paste event?Hello Debaditya,
When pasting values the
cellvaluechangedis triggered.
And if you paste multiple cells it is triggered for every cell, so you know each cell’s old and new value.
Here is an Example.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/Which version of JQXGrid are you using in the given example ?
Hello Debaditya,
The example is using the latest version of jQWidgets- 6.0.6.
Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.