Column gets submitted on save with no change

Column gets submitted on save with no change

Matthew CzajkaMatthew Czajka Posts: 10Questions: 3Answers: 0

I have inline editing on my table and when I click submit for changes, the data always includes one column (complete) regardless if the value within it changed. Is there a way to fix my code so I'm not always submitting a change for that column. My code for the javascript and controller are attached.

Answers

  • Matthew CzajkaMatthew Czajka Posts: 10Questions: 3Answers: 0

    I found out the problem, but I dont have an answer as to why it happens. But when I have the value as a boolean it seemed to come in regardless of the change, but when I switched it to be a string of true/false then the code didn't care if it was changed unless it was.

  • allanallan Posts: 54,897Questions: 1Answers: 8,605 Site admin

    Short answer: The type will be changing.

    Long answer: Editor reads the field values from the input elements (once they have been written to them), so it can loose the type (e.g. typeof ...). Your fields are all regular text inputs, so it will always be reading them back as text.

    It does do some type handling for radio, select and checkbox inputs which would resolve this. So since it is a boolean value, perhaps a checkbox or radio input would be appropriate for you here?

    Allan

  • Matthew CzajkaMatthew Czajka Posts: 10Questions: 3Answers: 0

    In this instance, they want to be able to see the words "True" or "False" so a checkbox or radio input wouldn't really be accepted here. Thank you for your input though.

Sign In or Register to comment.