Hot answers tagged

21

Since you are using SharePoint 2013 I would recommend you to consider the following approach. In SharePoint 2013 was introduced a so called Client Rendering Mode (CSR) which is intended for rendering of List Views and Forms using HTML and JavaScript and which is a default rendering mode. About View selector menu As part of CSR ClientPivotControl control (...


17

I know you can do this in 2010 but cannot remember on 2007. If you go to list settings and into Advanced Settings there is an option there to only allow users to see and/or edit their own items. If you set this to only being able to edit their own but can see all then you can use a filter where Created By = [Me] on the views you want to control.


12

Have you tried using [today]-180?


11

Modify the view and select "Title" column instead of Title (linked to item with edit menu) . If you want Title column to be clickable, which opens the item itself then select Title (linked to item) column. For Library use Name (linked to document) column if you need to open the document on click of name.


9

In the Filter settings of a View you can only use [Today] as is, you can do simple +- calculations but you can not use Functions. Remember: Do not add spaces in your View Filter calculations: [Today]-7 So you need to add two Calculated Columns calculating january1st =DATE(Year([YourDate]),1,1) and december31st =DATE(Year([YourDate]),12,31) and then ...


8

Get the web and list: $w = Get-SPWeb http://localhost $l = $w.Lists["My list"]; This is how you select the view "All items": $view = $l.Views | ? { $_.Title -eq 'All items' } Then just add fields: $view.ViewFields.Add($hereGoesFieldName); And update view: $view.Update();


8

Edit that page Edit web part Pages Under Miscellaneous check Disable view selector menu Click OK and Save page. :)


8

Try below code. It fetches all items from My Tasks view. using (SPSite site = new SPSite("https://sitecollectionurl")) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists.TryGetList("Tasks"); //list name if(list!=null){ SPView view = list.Views["My Tasks"]; //custom view name ...


7

If you have SharePoint designer, open the view with it and change the settings "read only" to FALSE and then you will be able to modify the views from SharePoint.


7

If you have a SharePoint task list where the task is assigned to a SharePoint group, you may notice that the My Task list does not show tasks even if you are a member of the group of which the task is assigned. Fortunately, there is a simple fix. It does require SharePoint Designer though. Open SharePoint Designer and then open the My Tasks view of the ...


7

Below is the javascript for JSLink(display template) file which does the custom sorting. You need to modify the 'viewNames' array to include the view names for your list. Add them to the array variable in the order you wish to see them on your page. You need to edit the webpart properties and add a link to this JSLink file for each view page if you want the ...


6

Go to your browser and click the arrow to modify the web part. Expand the Advanced Section and replace the Title URL with your desired URL.


6

I do not think that can be done. It shows the 4th view only once we click on it. (Dynamic HTML) But I found a workaround. Go to Edit Page. Click on Add web part and add a content editor with the links to all 4 views. Edit list view web part and disable the view selector menu. Also if needed, set tool bar to no tool bar and remove search. (Look where to ...


6

SharePoint 2010 Use ClientContext structure that is generated on the client-side and contains List View details: //find active View Id function getCurrentViewId(listId) { var viewId; for(var ctxKey in g_ctxDict){ var curCtx = g_ctxDict[ctxKey]; if(curCtx.listName == listId){ viewId = curCtx.view; break; } } return ...


6

You need to add two calculated columns that will work out the start and the end of the month. (This example uses [Due Date] but you can use any date/time column) "Start of Month" =DATE(YEAR([Due Date]), MONTH([Due Date]), 1) "End of Month" =DATE(YEAR([Due Date]), MONTH([Due Date])+1,1)-1 Then you setup a filter in your view for... "Start of ...


6

Try filter by numbers: Status Value Not Started 0 Failed on Start 1 In Progress 2 Error Occurred 3 Canceled 4 Completed 5 Failed on Start (retrying) 6 6 Error Occurred (retrying) 7 7 Canceled 15 Approved 16 Rejected 17 I also used my own statuses so added "Not equal 18", "Not equal 19", etc. Answer found here: https://social....


5

You could use Client Side Rendering (JS Link) and the OnPostRender property. When you use a filter in the list view it will trigger the OnPostRender again. Check out this article for more information. Code example: (function () { var overrideCtx = {}; overrideCtx.OnPostRender = []; overrideCtx.OnPostRender.push(function() { ...


5

The following CSR template demonstrates how to customize the appearance of menu options in list view, in particular in the example menu options are displayed sorted by title in descending order: SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ 'Templates': { 'Header': renderHeaderTemplateForDocuments } }); function ...


5

You have to use person/group field is equal to [Me], not contains. Even if the person/group field contains multiple users, it will still filter correctly when using is equal to [Me].


5

Get sharepoint list items by view name: using (SPSite site = new SPSite("http://siteURL")) { using (SPWeb web = site.OpenWeb()) { // Get data from a list. string listUrl = web.ServerRelativeUrl + "/lists/tasks"; // List URL SPList list = web.GetList(listUrl); SPView ...


4

No The only way to do this would be creating a separate page for each "audience" which are security trimmed. You can then place a List View Web Part on each page which contains your custom view. Of course, the challenge then is providing appropriate navigation :)


4

I found the way to make it work: overrideCtx.Templates.Group = CustomGroup; function CustomGroup(ctx, group, groupId, listItem, listSchema, level, expand) { var html = '<div style="float:left">' + listItem[group] + ' : </div>'; return html; }


4

Add after </Where> <QueryOptions> <ViewAttributes Scope="RecursiveAll" /> </QueryOptions> Reference: Need a CAML query to "show all items without folders" in sharepoint list view.


4

This might classify as more of a work-around than a solution, but I used the guid of the view as the webpart id. I decided to look into the content database to see how views are stored. In the stored procedure proc_CreateView I found that views are actually stored in the AllWebParts table with the ViewId inserted into the tp_ID column. So I added the ...


4

Without code On library click Create new view based on for ex. All items. Check columns you want to view and sort it how you like. Under Filter click Show items only when the following is true Approval Status --- is greater than --- 0 << this is for all unpublished(Rejected, Pending, Draft) Click OK For Published view create one more view with ...


4

I don't think this is a problem. Otherwise you could create a new View which looks the same as AllItems.aspx, set this as default view and give it your desired title.


4

I have experienced this same issue. What I have found is that after you add the first item the list view will default to the Standard View NOT Quick Edit. So just add one item, navigate to the view (i.e. do not just refresh) and you should see that view no longer defaults to Quick Edit. Note that this occurs for the other views when no items are found. Such ...


4

I've had the problem many times and solved it quite easily. I don't know the root cause, but the solution is to create a new view. I only experienced this when creating a new list. Typically making a list from an Excel Export, and then adding a webpart of narrative content on top. I create a new view, and delete the old view. inserting an item into the ...


4

You can create a filter on the "Created" column and use: [Today] -1 to return records/documents created yesterday (for example). If you use multiple filters, you can filter documents for -14 days ago OR -15 days ago OR -16 days ago etc etc I hope this helps, Best, George


Only top voted, non community-wiki answers of a minimum length are eligible