I'm trying to combine all the pieces I need into one external client side rendering file so I only need to maintain one file for my list.
When we create a new item in the list there are some csr things I want to do on the NewForm when I render it, and I mostly have the CSR working for that. Upon save, there I have a custom PreSaveAction
that creates some other list items and modifies the user input on the page.
When editing an existing item, there are some different things I want to do with the colums and I have the csr doing that correctly. I also want to have a custom PreSaveAction
, but this time it needs to just updated the other list items it created on the new form.
Basically I control for New vs Edit in the csr like this
customContext.Templates.Fields = {
'SpecialColum': { "NewForm": NewFormRender,
"EditForm": EditRenderFunction}
}
And that knows which form we're on because that is how it was designed to function.
I see that ctx.BaseViewID
is a value of either NewForm
or EditForm
. But by the time I get to my custom PreSaveAction the ctx is long gone.
How do I pass the context BaseViewID to my PreSaveAction?