Usually undefined means I forgot to add a field to a view (!), but in this case I'm using a dataview and the field is definitely there.

The key line - the undefined field is Image_x0020_upload:

var ret = "<div class='slide'><a href='xxxx/Post.aspx?ID=" + ctx.CurrentItem.ID + "'>" + ctx.CurrentItem.Image_x0020_upload + "<br /><h5>" + ctx.CurrentItem.Title + "</h5></a></div>";
return ret;

This works within the native site but when I add the dataview webpart linked to this list to the parent site, the image field is undefined while the other fields display correctly.

  • 1
    As a starting point investigate what fields are actually available by doing console.log(ctx.CurrentItem) and use your browser's developer tools to drill down through it. It might give you some clues. – Submits Oct 6 '15 at 8:47
  • The field is present - and now it "started" working in IE and Chrome but not in Firefox. Which is weird ... – matt Oct 6 '15 at 13:26
  • The plot thickens - when I move everything over to a production page (in same library as test page), the image field shows in edit mode but not when I save the page. So the script runs, other fields show just not the image upload field. – matt Oct 7 '15 at 0:53
  • Hmmm - when I checked the page in, the image field appeared. Another appalling Msft design. Still no luck in Firefox. – matt Oct 7 '15 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.