jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Copy Paste Issues in jqxGrid
Tagged: #jqwidgets-grid, angular grid, bootstrap grid, javascript grid, jquery grid, jqxgrid dropdownlist column disable paste
This topic contains 5 replies, has 3 voices, and was last updated by Hristo 8 years ago.
-
Author
-
Hey,
So i’ve been working with the jqxgrid to be the interface to a relational database i’ve built, But there are a few issues i’ve been having and was hoping to get some advice on.
Is there any way to intercept/mutate a value being applied to a cell via a paste operation (particularly in the case of a dropdownlist columntype)?
Additionaly i’ve seen the following things which seems a bit odd
non-editable fields can cause the
updaterow
function to be called if they have a value pasted over the top of them. (additionally the display label changes). This doesn’t seem like intended behaviour and causes us some issues as the values are primary keys in a lot of cases.pasting on top of a column configured as
columntype: 'dropdownlist'
In (http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridkeyvaluecolumn.htm?) for example if you:
-select and copy string field
-select an employee without going into the edit mode and pasting
-enter edit mode on one of the other string fields.
You will notice that the employee name has been overwritten. And under some circumstances i noticed that the overwritten value would appear as an option in the other drop downs although i wasn’t able to get a reliable reproduction of that eventHi pmcintosh,
Thank you for your feedback. As a solution you could disable the “paste” operation for the “Employee Name” column in the example that you used. You can do that using the
handlekeyboardnavigation
function. You can check for the datafield of the dropwodnlist column and disable the CTRL+V keycode combination for pasting. You could also intercept the value being pasted.You can read more about it API documentation http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm?search=
Best Regards,
ChristopherjQWidgets Team
http://www.jqwidgets.comHi Christoper, Thank you for your prompt response.
Would you be able to provide an example for being able to copy the cells of the first row to the second ensuring the primary key does not change and with the ability to mutate the data? I cant figure out any way of doing that with the navigation event alone
I’ve prepared a fiddle https://jsfiddle.net/pmcintosh/tsfavt0w/2/
Note: the sample will highlight the issue where its possible to copy and paste over a non-editable field and have the updaterow function alert you to its modification.
Additionally I’ve noticed some other issues that can be seen in the source provided.
1) The other thing I noticed is that if you copy the X Val 1 field, and then hold down ctrl+v on another field, it will start concatenating the values creating numbers like 1, 111 and 1111
2) The event appears to fire 3 times with no discernible change in the event args when you hit ctrl+v in a field. (this is solved by returning true in the event handler but i found it strange none the less)
Also the columns ‘cellvaluechanging’ event does not fire when pasting a value into it.
I noticed
Fixed an issue in jqxGrid regarding the clipboard paste functionality.
in your April-01-2017 v4.5.1 Release,
I was wondering if that included a fix for any of the above issues?
Hello pmcintosh,
We work on the issues by priority.
Thank you for your assistance in this case.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.