jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Returning false on cellbeginedit overwrites other cells
This topic contains 5 replies, has 3 voices, and was last updated by Hristo 7 years, 10 months ago.
-
Author
-
I have a grid that, based on certain conditions, I have to disable a cell (only for the row I am on).
I have gathered that the best way to do this is to recognize this condition in the cell’s ‘cellbeginedit’ event and return false.
This seems to work, but I am now realizing two weird behaviors (across all browsers) when doing so.
If a user mouses to the cell that cannot be edited, types in (lets say) ‘1234’, then mouses to another cell that is editable (it does not matter which row), the last character typed (in our case – ‘4’) is applied to that cell. This occurs even if the editable cell already has text – it overwrites it.
We are using jQWidgets v4.3.0 (2016-Oct).
begincelledit routine:
var beginControlEditing = function (row, datafield, columntype) { var _row = checkRegGrid.jqxGrid('getrowdata', row); if (_row) { if (_row.ControlType == null || _row.ControlType == 0) { return false; } } else { return false; } return true; } var beginEditing = function () { if (ckVoid || o.Check.Id != 0) { return false; } return true; }
Grid Columns:
var gridColumns = [ { text: 'Account', columntype: 'textbox', datafield: 'AccountNumber', width: 150, cellbeginedit: beginEditing, cellvaluechanging: allcapsInput, initeditor: function (row, column, editor) { editor.css('text-transform', 'uppercase'); editor.jqxInput({ maxLength: 15 }); } }, { text: 'Control', columntype: 'textbox', datafield: 'ControlNumber', width: 175, cellbeginedit: <strong>beginControlEditing</strong>, cellvaluechanging: allcapsInput, initeditor: function (row, column, editor) { editor.css('text-transform', 'uppercase'); editor.jqxInput({ maxLength: 20 }); } }, { text: 'Reference', columntype: 'textbox', datafield: 'ReferenceNumber', width: 175, cellbeginedit: beginEditing }, { text: 'Description', columntype: 'textbox', datafield: 'Description', //width: 540, width: 'auto', cellbeginedit: beginEditing }, { text: 'Amount', columntype: 'numberinput', datafield: 'Amount', width: 115, cellsformat: 'c2', cellsalign: 'right', createeditor: initCurrencyEditor, cellbeginedit: beginEditing } { text: '1099', columntype: 'checkbox', datafield: 'Payee1099', width: 50, cellbeginedit: beginEditing }, { text: 'Box', columntype: 'textbox', datafield: 'Payee1099Box', width: 60, cellbeginedit: beginEditing } ]
Grid initialization:
$("#myGrid").jqxGrid({ width: 1400, source: gridAdapterC, height: 400, altrows: true, sortable: false, editable: true, editmode: 'selectedcell', selectionmode: 'singlecell', theme: theme, handlekeyboardnavigation: keyIntercept, columns: gridColumns });
I double-checked to be sure nothing in the cell’s ‘cellendedit’ may be causing this, but it does not fire if I return false. Does anything stick out that could be causing this?
One more thing I noticed. Special characters like “+ – = , . *” do not seem to be firing the cell’s ‘cellbeginedit’ event (or open the editor). They simply appear in the cell (tested across all browsers).
Thanks for the help!
Hello mattcash,
Thank you for your message and for this feedback. We really appreciate this.
Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHello,
I was wondering if there was a way to correct this, or if there was possibly a fix coming in a future release? If not, is there an alternate route to take on disabling the cell of a column of multiple rows based on logic at the time the cell is entered?
Thanks!
Hello mattcash,
I have created a work item for this case but cannot provide you a solution.
Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHristo,
This issue occurs even without a
cellbeginedit
handler on the column.Fiddle: https://jsfiddle.net/jroj3o0a/6/
Click anywhere in the grid other than a Product column cell and type some text. Click any Product column cell, last character from keyboard replaces text. Seems to happen only with alphabetic and numeric characters, not with special characters.
Can you give status of work item or suggested workaround?
Hello mattcash,
We cannot engage with exact time when an issue will be fixed. We work on them with priority.
In this case, we recommend checking our “Release History” page from time to time:
http://www.jqwidgets.com/jquery-widgets-documentation/documentation/releasehistory/releasehistory.htm?search=Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.