purtuga / SPWidgets

Sharepoint Custom UI Widgets
74 stars 34 forks source link

SPControl Upload - how to use for dummies? #31

Closed Critzesl closed 9 years ago

Critzesl commented 10 years ago

I apologize for the noob question but I'm new to this kind of SharePoint customization and I don't quite understand how to set up the control upload widget in my code.

I have a custom newform.aspx page where I want to have the file upload button. This page is calling a script file and I understand at bare minimum I need to have something like $("div.file_upload").SPControlUpload({ listName: "Shared Documents" }); included in my script in order to link to the plugin, but I don't understand what html elements I will need to add to my aspx page to make that work and I don't get where that script line should be going (i.e. on click of a button? or just in document.ready()?). I tried checking the demo page but I confess I was a bit overwhelmed when looking at the source.

Can you provide a basic dummy-version example with all parts detailed? For example: "This is what you'd drop into your aspx page:

" "This is what would then go in your script file in the document.ready() function: $("#upload").SPControlUpload({ listName: "Shared Documents" });"

Thanks so much!

purtuga commented 10 years ago

I'll try to give you a so simpler example ASPX page as soon as I get a chance.

I assume your code setup looks similar to what is on the docs? Here: https://github.com/purtuga/SPWidgets/blob/master/documentation/SPWidgets.md#usage

These are the steps:

  1. On your page, include Jquery, jquery UI and this library. This assumes you are using the latest (bleeding edge) version (from the dist folder here on github). If using an older version, the. SPServices is also needed.
  2. Also on your page, include the following in the area where you want the upload to appear:

  3. Initialize the widget on that element. How you do it, really depends on the use case. But, yes, you can use the jQuery document ready callback:

    $(document).ready(function(){ $("div.file_upload").SPControlUpload({ listName: "Shared Documents" }); });

If this does not get you anywhere, you will need to post your code and page html. I also assume you have no errors showing up in the console - correct?

Paul T.

-- Sent from Mobile

Critzesl commented 10 years ago

Ohhh ok...guess I was making it more complicated than it needed to be in my head! It's working now with the minor adjustment of making it $("#file_upload").SPControlUpload({ listName: "Shared Documents" });

Thanks for your help!!

purtuga commented 10 years ago

Ok. Good. The goal with these widgets is that they be as easy to use as other traditional jquery widgets and not like SharePoint (.net inspired) widgets.

Paul T.

-- Sent from Mobile

rajeshr565 commented 9 years ago

Hi purtuga,

As per documentation, i had successfully uploaded the documents in document library using Sp-widgets but i am facing one issue on this. The Uploaded document not been checked-in the library and it shows "working on it" message in the page.

I doesn't know where i made mistake. Please me help on this ;)

Thanks in Advance,

Rajesh R

purtuga commented 9 years ago

Any errors in the console? What version of SPWidgets are u using? Also, can you post your code and a screen capture of the "working on it"

/Paul

Paul T.

-- Sent from Mobile

Critzesl commented 9 years ago

Hi again! One small issue I'm facing...I had it all working perfectly well in Firefox and Chrome but when I opened it in IE the upload box started looking like this:

screenhunter_02 dec 08 15 10

For some reason it's like it is trying to pull in the Office 365 header bar. I can't understand why this would suddenly happen only in IE but I also can't find a way to hide it to save my life. Any ideas? When I click "Upload" the iframe still shows up normally without a ribbon or O365 header bar but before that the upload box looks funky with a name and a dropdown. Thanks!

purtuga commented 9 years ago

I'll try in O365 to see what's going on. I know they (Microsoft) updates that often, so maybe a recent update broke the plugin. And IE always seems to be given special treatment. I'll get back to you soon.

Paul T.

-- Sent from Mobile

purtuga commented 9 years ago

What version of SPWidgets are you using? I just tried in O365 and I'm not encountering the issue.

Paul T.

-- Sent from Mobile

nmn-id commented 9 years ago

Hi purtuga,

Can you show the implementation of SPControlUpload Step by step

or with some sample Demos?

Mohan.N

purtuga commented 9 years ago

@nmn-id Have you looked at this usage example in the documentation? https://github.com/purtuga/SPWidgets/blob/master/documentation/SPWidgets.md#usage

The steps are detailed above in my first response to this thread.

nmn-id commented 9 years ago

Hi,

Below is my code which I am using in CEWP in O365

But how I will pass my file here?

Select File
purtuga commented 9 years ago

This is a closed issue. Can you open up a new one that details your specific trouble?

On Saturday, May 9, 2015, nmn-id notifications@github.com wrote:

Hi,

Below is my code which I am using in CEWP in O365

But how I will pass my file here? Select File

— Reply to this email directly or view it on GitHub https://github.com/purtuga/SPWidgets/issues/31#issuecomment-100469325.

Paul T.

-- Sent from Mobile

MarioVanDenEijnde commented 9 years ago

simple upload html

Hello Purtuga,

I have the following code below: But my page shows empty. Questions:

<!doctype html>

Untitled 1

Kind regards, Mario

purtuga commented 9 years ago

Can you open a new issue instead of using this old one?Also: your code did not come through.  Take a look at github markdown format to know how to do it.  Paul -- sent from mobile