1

I'm customizing the DisplayForm of a list, and I want put a button on footer to EditForm, but in the ctx has no edit form url and no CurrentItem.ID.

How can I do this?

Carlos
  • 319
  • 1
  • 9
  • 22

1 Answers1

3

Getting from ctx

var itemId = ctx.FormContext.itemAttributes.Id;

I have executed above code under OnPreRender & OnPostRender both. So you can use it where you need it.

I think it is easier to get from Query String rather than from ctx.FormContext.

As per Asad's comment, Getting from Query String

var itemId = GetUrlKeyValue('ID');

Have a look on this answer by Danny Engelman to read more about Query String.

Atish Kumar Dipongkor
  • 13,371
  • 5
  • 32
  • 64