A minimal code webpart that displays a single picked item from a list - sharepoint

I'm not sure this is possible, but figured I´d give it a shot. First a few pre-requeistes and environment details:
I´m using SharePoint 2010, SharePoint
Designer 2010, VS 2010
I want to create as little code as
possible, preferably, create it all via UI or Designer
use out of the box components as much
as possible
Here is What I want to do:
Have a custom list with custom columns (easy part)
Create a webpart with an edit interface to select a single item from this list
This same webpart when visible would display the contents of this selected item in a given layout
I know I can do this creating a custom web part and code it all from scratch, I guess my main question is, is there a way to do this with less code and more out of the box components in SP2010. If not, I guess I'm left with lots of C# code.
Any tips, or pointers in this direction will be most welcome. Thanks in advance.

I think what you're looking for is the Data Form Web Part.
Unfortunately, I can't find any good tutorials for 2010, but hopefully the steps should be similar to setting it up in 2007.

Thanks all for the update. In the end, i had to create quite a bit of code to get this to work:
created a web part that enumerates
the content type,
creates a light box that has a picker
then stores the ID of the content in a column
Not the easiest way,but the only way I could get it working. Thanks again!

Related

SharePoint Online chart

I would like to display a graph on the home page of my sharepoint online site. I can add in a quick chart but it does not fit my requirements.
Basically, I have a task logger where i log all incoming tasks, they are assigned a status - closed, completed, in progress, on hold, and pending.
I would like to display this visually on the home page so we can see how many tasks per status.
I think the x axis would the status and the y axis would be the value.
I'm not sure how to achieve this? i've seen multiple examples of coding for this but being inexperienced in coding, i'm not sure how to amend or adapt the codes for my requirements.
If someone could please provide a solution or have any ideas, that would be greatly appreciated.
We can use the solution below from GitHub to achieve it.
Modern Charts
Or we can use modern script editor web part with chart js plugin and REST API to achieve your requirement.
In classic site page, we can use script/content editor web part with custom JavaScript code to achieve it.
If You don't plan to code the solution I would suggest two different then quick chart webpart approaches:
File Viewer webpart - You could create some excel file to store all Your task list there. This file could be stored on some document library. The excel file could have data in one tab and chart in other. Using File viewer You could add this excel file on any SharePoint page. On one Page You could present the tab to change data (tasks), on other the tab that has the chart. I know..a bit of a workaround but this is one of the simplest solutions I thought of without coding :)
Power BI- this tool for sure may will fit any needs as in this tool You may do almost anything. Of Course You need Power BI server for this. You may create any chart/report with this also from data taken directly from SharePoint
Hope this will be of any help to You

One custom display form for all the lists

Good day to you. I am newbie in SharePoint 2013 so please bear with me. I have created around 15 lists in my website each containing same columns but different data (they differ semantically).
I am aware that we can change the default view, edit and display form for each list by creating new form in SharePoint Designer 2013. This seems like a very bad approach as far as the maintenance is concerned. I know my lists are exactly the same so why do I have to create same 15 display forms for each of the lists?
Is there a way to create one custom Display form (may be in a central location, i don't know i am just thinking :P ) for all the lists? Is there a way to tell a list to use a specific display form? Any help will be highly appreciated. Thanks.
If i understand your question correctly, you have 15 lists with same set of columns. You want to change the display/look of the form. All 15 lists should have same look and feel right!! If yes, then why don't you try with some html, javascript solution. Since you are in sharepoint 2013, javascript support for solutions is very good like rest queries. You can use SPServices also.
If you want to to add data to the list whenever you click on the "New Item" link in the list then hijack this link such that it should navigate to your custom form. Pass your list name as query parameter. Whenever user is saving the form, get the list name from the query parameter and save the data to that list.
There could be another ways also to achieve the solution with html and javascript.
Useful links:
Microsoft, Microsoft, SPServices
Sam I think you can create a custom content type and create custom display form for your content type. Enable the content type in each of your lists so automatically this customized form would be available.
The advantage of this approach is that suppose if you need one more list after some time you can just add this content type and your form would be available into the new list as well.
The approach is explained in the link below.
http://blogs.msdn.com/b/varun_malhotra/archive/2009/06/06/define-custom-new-edit-display-forms-for-content-types.aspx
Check this one also
https://joshmccarty.com/2011/02/sharepoint-custom-list-with-custom-content-types-and-custom-display-forms/
Just wanted to write the solution which I implemented as it might help others as well. (Thanks Hiren and Mihir for your valuable inputs)
I had 15 lists and I was showing the data to the user using content search web part with custom display template. All of the lists were using the same display template so I made a new page just to show the item details. In the display template I pointed the item URL (i hijacked the list name and the current item id) to my new page and displayed the item. Let me know if anyone is interested in the whole solution or further elaboration is required.

SharePoint 2013 KnockoutJS Lookup columns

I have a basic knockoutjs project loading data from a SharePoint 2013 list scenario. Getting data and displaying data is easy, the problem that I'm running into is on the edit mode displaying the proper control. Everything should not be a textbox. This means the people picker control to dropdownmenus to calendar controls.
MSFT has some pretty good documentation on using the client side people picker control here"http://msdn.microsoft.com/en-us/library/office/jj713593.aspx
The problem that I have is calling this control inside my viewmodel.
Setting the value of the control doesn't look difficult courtesy of this blog post: http://www.sharepointcolumn.com/sp2013-setting-people-picker-value-in-newform-aspx/
I attempted to looking into computed values, but that doesn't seem to work. Does anyone have a blog post that I skipped over? The closest related post that I can find: http://yetanothersharepointblog.wordpress.com/2012/12/11/working-with-sharepoint-lookup-columns-in-knockout-js/
Lastly since it seems that I'm the only one doing this, does anyone think that I should not be reinventing the wheel with my forms and should just link each item to the appropriate SharePoint list item in edit or display view? I suppose that would be easier.
From a SharePoint Professional to another, I would highly recommend you to do that.
Just redirect the user to the item edit/display item page an let SharePoint take the leash of how to handle UI form elements.
Because, assume that you implement your custom form, what if the user decides to add one more site column to the list? Will you update your code to support another field?
From my personal experience with the beast I've come to the conclusion that structural implementation over already existent functionality tends to go wrong.
Also, if you have some kind of listing of items custom made and you want to provide editing, try to do something opening a pretty SP.UI.ModalDialog, its elegant and you use the sharepoint to do the work for you.
But it's just an advise.

Template item in simple SharePoint list

We don't do any SharePoint development, but I was wondering if there's a way in the web UI to create the ability to copy an existing list item as if it were a template.
I don't think there is any way to do that without at least some code or using SharePoint Designer. In code it is fairly simple to do, but I don't think this is what you are asking for.
You could switch to datasheet view and then use copy & paste, but that isn't really a great solution either.
You could use a SharePoint Designer workflow to create duplicates of an item through the WebUI, there is an example of this here.
We have this capability as part of our product. The product is called Smart List Lite, it is free and it also install a new custom field type called Item Copy Field, I think this is what you need
http://www.infowisesolutions.com

How to tie a dropdown list to a gridview in Sharepoint 2007?

This should be a really really simple thing, but for some reason it is just eluding me.
I want a Sharepoint page which will have a drop down list that is tied to a database lookup table.
When an item is selected and they click a GO button, I want it to update a gridview that is also on the page.
I'm looking for a simple how to - while assuming I'm a sharepoint idiot. BTW, I am using the Microsoft Office Sharepoint Designer.
Thanks,
Edit:
My need is actually very simple. I want to filter the results of a query using a drop down list. This used to be called a master - detail relationship.
For example, my regular data has school name, application name, and how long the application was running. Because there could be a hundred applications per school and there are 60+ schools, I only want to show one schools information at a time.
So, I want to put a drop down list at the top of the screen which contains the list of schools. When one is selected, the gridview should be updated to reflect the new schools information.
Chris.
I currently use a drop down tied to one sharepoint list to filter a dataview of another sharepoint List.
The instructions are here:
http://blogs.msdn.com/sharepointdesigner/archive/2007/03/05/asp-net-controls-filter-the-data-view.aspx
I'm not exactly sure of the specific needs here, but it seems that you are trying to stretch a bit beyond what Sharepoint Designer is well suited to. To look up data, you do have access via the dataview web part, which is here:
http://office.microsoft.com/en-us/sharepointdesigner/HA100948041033.aspx
However your filtering needs may prevent you from using this. If you want to do it .net without knowing too much about MOSS, you can use the "son of smartpart" (google it) which allows you to host standard .net user controls in webparts.
Hope this helps!

Resources