Dependent fields don't work well with Keytable Inline Edit text fields
Dependent fields don't work well with Keytable Inline Edit text fields
Hello,
As per manual entry for dependent() fields:
By default the dependent() method will trigger an update call whenever a change event is activated upon the field's input element.
This causes a problem with text fields in inline edit mode. Say, I have a calculation like A = 0.2 * B, where B is a text field. My goal is to calculate A after the user has completed entering value in B. Lets say, I would like to enter 1000 in B. However, due to the behavior quoted above, as soon as the user enters '1', A is calculated and the record submitted, which is undesirable. Events mentioned in the examples - 'keyup' and 'change' don't look suitable for the case at hand. Is there some way to tell dependent() API to wait for focusout?
Thanks,
harsha
Answers
HI Harsha,
I would actually recommend that you use
columns.render
to calculate and display the calculated value here.The other option is to use
field().input()
to get theinput
element directly, and attach your ownchange
event listener.Regards,
Allan
Hi Allan,
Thanks for responding. It appears keyTable springs to action on keydown events. The example given in this page, helped me fix the issue.
Thanks,
Harsha