Dependent fields don't work well with Keytable Inline Edit text fields

Dependent fields don't work well with Keytable Inline Edit text fields

hnhegdehnhegde Posts: 68Questions: 17Answers: 0

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

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin

    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 the input element directly, and attach your own change event listener.

    Regards,
    Allan

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    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

This discussion has been closed.