Hello,
I have migrated my application from 2014 version of controls to 2016.1 version and I have used igNumericEditor in multiple screens and also in the Grid Add Row. After migrating to new version copy Paste has stoped working in all the screens including grids.
One more thing is when I disable ajax post to server from my javascript this copy paste starts working. I am not sure if this disabled functionality of Paste is bacause of any security feature of new version.
Pls share your thoughts as I m blocked with this.
Thanks,
Parag Dave
Hello Vivek,
Thank you for using our community!
I’ve created a code sample in order to investigate your case. When I am pasting a valid value in the editor it is working fine, if I am pasting an invalid value, for example “- 3” instead of “-3”, the value of the editor is reverted. You could check if the value you are coping is valid.
In my opinion this behavior is related to the following issue:
https://github.com/IgniteUI/ignite-ui/issues/504
You could add comment that it is reproducible in igNumericEditor, too.
Please do not hesitate to contact us if you have more questions regarding this issue.
Regards,
Aneta Gicheva,
Infragistics
Hi Aneta,
Thanks for your reply.
I am using igNumericEditor like below, and paste valid numeric values. However the ValueChanging event is not fired and the value reverts to the previous value. Strangly if i paste invalid value it remains in the textbox and raises the ValueChanging event and throws error invalid value. I am totally confused with this behaviour.
HTML Contol:
<input id="txtFixedDollar_@(Model)" class="inputbox4 msalloc-fix-igTextEditor" style="width:100%" type="text" value="" tabindex="@(Model)85">
Instance of igNumericEditor:
var fdField = $('#txtFixedDollar_' + i);
fdField.igNumericEditor({ maxLength: msalloc.FixedDollarMaxLength, maxDecimals: 2, minDecimals: 2, maxValue: msalloc.FixedDollarMaxValue, minValue: 0.00, value:0.00,dataMode: 'decimal', valueChanging: valueChangingHandler(fdField) });
Value changing Event:
var valueChangingHandler = function (editorField) { return function (evt, ui) { if (ui.newValue == "5e-324" || ui.newValue == undefined || ui.newValue == false || ui.newValue == null || ui.newValue == '') { ui.newValue = 0.00; editorField.val("0.00");} else { editorField.val(ui.newValue.toFixed(4).toString()); } }; }
I investigated the code snippet you send me and I found that you are using dataMode: “decimal”. As you could see here, we are not supporting “decimal” dataMode.
http://www.igniteui.com/help/api/2016.1/ui.ignumericeditor#options:dataMode
I created a sample with your code snippet and add console.log in valueChanging event handler. When I test it the event was triggered even if I am pasting an invalid value. My suggestion is to update to the latest version of 16.1 which is 16.1.20161.2145.
Furthermore, the else clause you mentioned is hit when the customer enter value which is not a number and the revertIfNotValid opition is set to true.
I am attaching my sample. Test it and let me know if you are still able to reproduce the issue and give me step-by-step instructions for reproducing the issue.
I am looking forward your answer.
To give more details on the issue,
I am currently trying to migrate to 16.1.20161.1009 version. And I see issue in past functionality in igNumericEditor. I and my team has spent more than 2 month in upgrading from 2014 to 2016 Volume 1 version.
Also I checked in 16.2.20162.1035 version looks like this issue fixed and I am able to paste values in igNumericEditor. But this challenge for me now is I have to perform end to end testing for all the functionalities if I switch to latest version, and this validation will take more than 3 weeks including UAT before I go to production. Is there any better option to stabilize the current 16.1.20161.1009 version.
Also I want to understand release cycle of these framework JavaScript files? How do I get hold of stable version for my application and so that it can be delivered to production?
Also pls confirm if the earlier code snippet I sent is a product bug which has been addressed in the later version.
Sorry correcting the code snippet...
_insert: function(newValue, previousValue) { if (!isNaN(newValue = this._parseNumericValueByMode(newValue, this._numericType, this.options.dataMode))) { if (this.options.maxValue && newValue > this.options.maxValue) { newValue = this.options.maxValue } else if (this.options.minValue && newValue < this.options.minValue) { newValue = this.options.minValue } if (!this._validateValue(newValue) && this.options.revertIfNotValid) { newValue = previousValue } else if (this.options.revertIfNotValid) { newValue = previousValue } else { newValue = "" } this._editorInput.val(newValue); this._setSpinButtonsState(newValue); this._processTextChanged() } },
Pls ignore the snippet in my previous post.
I debugged the Infragistics.lob.js code and found the below validation implemented for the values pasted in the igNumericEditor. What I notice is the conditional handling is incorrect and if the valid value is pasted then the text box it will go to else if clause or else clause where the newValue is getting set to either previous value or blank. Can you look into this code at your end and confirm expected behavior.
_insert: function(newValue, previousValue) { if (!isNaN(newValue = this._parseNumericValueByMode(newValue, this._numericType, this.options.dataMode))) { if (this.options.maxValue && newValue > this.options.maxValue) { newValue = this.options.maxValue } else if (this.options.minValue && newValue < this.options.minValue) { newValue = this.options.minValue } //if (!this._validateValue(newValue) && this.options.revertIfNotValid) { // newValue = previousValue //} else if (this.options.revertIfNotValid) { // newValue = previousValue //} else { // newValue = "" //} if (!this._validateValue(newValue)) { if (this.options.revertIfNotValid) { newValue = previousValue } else { newValue = "" } } this._editorInput.val(newValue); this._setSpinButtonsState(newValue); this._processTextChanged() } }