Inline editing submits the changed field's value only, I need to join another (editor) field / .net

Inline editing submits the changed field's value only, I need to join another (editor) field / .net

ASWSASWS Posts: 43Questions: 4Answers: 0
edited October 2022 in Editor

Upon editing a field inline in editor, the changed/updated field's value is correctly submitted!
All other fields are not submitted. This is ok so far.

I explicitly do not want to always submit & update all fields of the current row, means I do not want to specifying "submit: 'allIfChanged' ", for a couple of reasons.

OK. BUT...

I anyway do need to submit ONE more field from the updated row, e.g. some ID field, to query on and enrich submitted data in the following process.

Therefore I am using a data "Validator" to read the submitted field's data and then adding or updating some other editor fields of this specific row, during each submit process.

I use:

.Validator((editor, type, args) =>
   {
    if (type.ToString() == "EditorEdit")
     {foreach (var d in args.Data)
      {
       var incomingData = d.Value as Dictionary<string, object>;
       if (incomingData.ContainsKey("JoinOneMoreFieldFromThisEditorRow.Submit")

... etc

I wanted to keep this question simple, so I hope this is enough to understand the idea and most likely someone has kind of an obvious "one liner" answer at hand. I did check some options cc preEdit aso, but I kind of still hope there's a more flagrant simple solution, like flagging any additional field of the updated row as "submit me too on change" or any similar mylazyworld optionflag... :)

Many thanks in advance for your advice
cheers, Mark

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    A possible quick answer would be to add that id to the data submitted to the server with ajax.data. The server could then extract it and do those mods you discussed,

    Colin

  • ASWSASWS Posts: 43Questions: 4Answers: 0

    Yes indeed, I ended up doing it the bold way with ajax.data, plus a receiving controller on the server side. Somehow I was just wondering if there wasn't a more api standard way to flag one or more editor fields to be submitted, together with the one that gets updated inline.

    Might be a usefull and elegant option to integrate, this represents a quite common usecase in my opinion...

    Many thanks anyway, Colin!

Sign In or Register to comment.