Include content in request to Server not established in Editor with .set()

Include content in request to Server not established in Editor with .set()

rldean1rldean1 Posts: 141Questions: 66Answers: 1
edited June 2020 in Editor

I want to include extra data in the request that is sent to the server. In the example below, WalkInScheduled is included in the Editor fields, and it has a representation in the destination DB. However, TimeSlot is in another database.

editor.edit(row, false)
.set({
    'WalkInScheduled': 1, // <--- in the main DB
    'TimeSlot': 187       // <--- NOT in the main DB, val will be used to update a different DB
})
.submit();

I feel like the answer to my question _might _be: just include this as a hidden field in the field definitions. I was just curious if there were a way to tack on values on-the-fly, or whatever.

fields: [
{
    // this field is NOT in the source database, but the response will be used in a DIFFERENT database
    label: "TimeSlot:",
    name: "Timeslot",
    hidden: true
}
]

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583
    Answer ✓

    You can use ajax.data for that - if it's a function, you can conditionally send values.

    Colin

  • rldean1rldean1 Posts: 141Questions: 66Answers: 1

    It is fantastic to be able to extend the special data object.

This discussion has been closed.