How do I set ajax.edit.url programatically?

How do I set ajax.edit.url programatically?

johnthomas00johnthomas00 Posts: 8Questions: 3Answers: 1

The server wants the url to include the ID of the record being edited in the PUT. I have the ID in the data. How do change the URL based on the data?

For example if the record ID were 251, I'd want to PUT the update here:
http://example.com/api/update/251/

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    Note sure of your context but isn't the url a string? Can you just replace it with a variable?

  • johnthomas00johnthomas00 Posts: 8Questions: 3Answers: 1

    It is a string, but I do not know how to set it based on the information in data. I am a newbie. If you have suggestions, I will try them.

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin
    Answer ✓

    Use can use _id_ in the URL string which Editor will automatically replace with the id in question - see this example.

    That uses the id in the query string parameters, but you can use it in any part of the URL.

    Allan

This discussion has been closed.