2

On SPO 2013 trying to deploy some custom markup code to bind a list

Markup code works when placed in Placeholdermain via SPD vs embedding the code Site Page webpart (EmbeddedFormField)

I have this code works perfectly when I use SPD 2013 and place it in the placeholdermain with SPD 2013. But if I use SPO Edit page embed code it will not bind the data to the dropdown control. Get nothing in the control.

<div id="uploadDiv">
   <label id="fileSelectorLabel">Select a file: </label>
   <input id="uploadInput" type="file"/>
   <script id="selection-options" type="text/x-jsrender">
    <option value="{{>#data.get_item('Name')}}#{{>#data.get_item('Title')}}#{{>#data.get_item('Department')}}">
      {{>#data.get_item('Name')}} 
    </option>
   </script>
   <select id="FacultyLookup">
   </select>
   <input id="clearUploadFormButton" type="button" value="Reset"/>
   <input id="uploadFileButton" type="button" value="Upload"/>
</div>
<div id="message">

</div>

Or is the issue that you cannot have calls to jQuery files from the embed snippet.

3

One technique you might try is using a Content Editor Web Part. To ensure SharePoint doesn't mess with the code, you could add the code in a text file to the site. Then in the properties of the CEWP, reference the URL to the text file. This will render the contents of the text file in the web part.

enter image description here

  • Thanks but in SPO 2013 I don't see the source view on the EWP. Noticed their are two ways to drop code on the page through the UI.. one way string out scripts and says to use the embed command .. I'm not sure what that is? What's promising is I have the code this way on another site and it's partially working there .. suspect the issue is a webpart is isolating me from data returned to the parent DOM. – Hell.Bent Nov 1 '13 at 22:20
  • I added a screenshot to show what I am talking about. Upload a text file with the code somewhere in your site. Then reference it from the Content Editor web part. – John Chapman Nov 5 '13 at 15:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.