Change View of Sharepoint XSLT List View webpart in javascript - sharepoint-2013

I have created a Sharepoint hosted app for Office 365. It has a page file "default.aspx". I have added an XSLTListViewWebpart on that page, referring a custom List I created within my APP project. I have a requirement that on a button click event, I need to change the View of the List displayed in the XSLTListViewWebpart. Since there is no server code within the APP, would this be possible in javascript? Or would it be possible to somehow change the query that the webpart uses?

You can try to use Javascript object model to achieve this. Please see this article.

Related

Adding Hyperlink in subgrid

I want to add Hyperlink for each row in subgrid. What I am looking is I want to display a invoice number as a link. When user clicks on that it should open a external window. Already tried with Hyperlink field available Dynamics. But its comes with https://.. I don't want to show the URL inside the grid.
Regards
Saman
I'm assuming your using the Out of the Box sub grid on the Web Interface / UCI, in which there isn't an out of the box way to render a clickable external URL.
Is the invoice in CRM, if it is a record in CRM and it can be related to the subgrid record, adding the lookup field to the view will provide a clickable link.
Your other option would be using a custom UI to build your subgrid, like Kendo or building a PCF.
Though I don't see any existing PCFs in the gallery that do this (https://pcf.gallery/categories#grid) you could likely use one as a starting point.

MS Access Web App: Link existing view to table

I have created a new view ("form") in my Access Web App using the menu buttons to create a new view. The view is bound to a table in my database. Running Access on my computer, I can select the view from the navigation panel on the left.
Now I would like to have a link to my view appear at the top of the page in the Web App. Much like the default List and Datasheet view that are created automatically for every new table.
How can I create a link to my view, so that I can select it when running my Web App in the browser?
(And in general: where's a good place to find documentation and help regarding Access Web Apps. I'm having a hard time finding anything online)
thanks for your help.
What entry point did you use to create this new view in your Access web app? If you used the Advanced button on the ribbon, that creates what we call a standalone view in your web app - a view that exists in the Navigation Pane in Access client. You can only open these types of views using macros.
In order to "associate" an existing standalone view to the View Selector at the top of the navigation, right-click the view name in the Navigation Pane and select Duplicate. a dialog box will appear that allows you to create an identical copy of the view and "associate" it with a particular table. It will then appear as a link in the View Selector. You can then delete the original view if you want.

customising announcement list in sharepoint 2010

I am trying to add a customised announcement list to the main page of my SharePoint site on this list, there will be 7 columns on the list but the challenge i'm having now is how to only display 3 out of the 7 columns on the site and the other columns will only be displayed when user clicks on add new announcement or clicks on the list itself. Please can anyone give me an idea of how to achieve this.
E.g: Assuming i customised an announcement list to have column: management, operations, Assets, Finance,HR,QHSE and Technical and added it on my SharePoint page via web-part, How can i make it to only display 3 of the 7 columns like management, operations, Assets while other columns will only be seen whenever users click on the add new announcement or go directly to the list itself. Thanks
For displaying only 3 columns, create a view and set it in the webpart options.
When you create a new view of a SharePoint list, it essentially creates a new .aspx page with the view customized per your definition. This can be done for standard views easily from the SharePoint list's web interface. This is the suggestion from Le_Freddo and should work for creating custom views but not for creating custom edit pages.
For that I believe you need to use SharePoint Designer. Open the site in SharePoint Designer then locate the list you're working on under 'Lists' in the 'FolderList'. You'll see 4 pages, AllItems, DispForm, EditForm, and NewForm. Make a copy of the EditForm (before you modify it), then open the EditForm to make your changes to it. You can add or remove fields from the page. In this way you can customize the Edit form to show all fields or only a subset.
You can also use this method to customize the other views (removing columns you don't want users to see).
When you're done, you can direct your List to use the new pages or define which page to use for each operation (View-All, Display, Edit, Create New) by setting the List's properties (right click the list in the Folder View, select Properties, then the 'Supporting Files' tab will have links to the pages configured for these actions).
Good luck...

Showing Announcement list in Custom Page in Sharepoint site

I am having a sharepoint site and i had added a custom aspx page and I want to show the announcement list items in that page. How to show the list items in a custom page ?. Helpful links and sample code would be helpful?
Access Your custom page from the browser and Edit the page by clicking Site action > Edit Page. If you have a Web part Zone available in your page then
Click 'Add a webpart'(for webpart page) > Click 'Insert' tab in ribbon > Select 'WebPart' > List and libraries > select the announcement list and click OK.
This will add a web part of announcement list in your page.
But if you dont have the webpart zone then i am afraid it is not possible directly,
But you can use client object model for this visit this
http://msdn.microsoft.com/en-us/library/ee539350%28v=office.14%29.aspx
I found a solution for my requirement. I had used XsltListViewWebPart for displaying announcement list in custom application page. I would like to thank everyone who offered me their advice thanks a lot.
The following link did it for me
http://suryapulipati.blogspot.in/2011/08/sharepoint-2010-show-add-new-item-or.html

Excluding list items created by certain users from a list's view

I have a custom list created in Sharepoint 2007 and displayed by a content query web part.
I would like to
Show all items to general admin users except those items created by two users.
The two admin users need to see all items in the list.
The first requirement is easily done by adding a filter to the view on the created by field.
The second one is where I need help, is there a way to set the view of a list based on the user logged in to acheive the second requirement?
Or is this achievable another way?
Many Thanks,
Nav
If user has SPBasePermissions.ManageLists permissions, he will have permissions to view all items in the list.
If its not about permissions, but just which view which user sees by default, then it will involve some sort of coding :
Either you create webpart which will switch to desired view for desired user. (Involves coding, building, deploying)
Use content editor web part to switch with javascript - not that nice solution. (Because page would reload when you open it).
In the end I created two pages one called restricted and the other for all users configured the views on each page for each group of users. Then I restricted access to the 'restricted' page to the relevant users.
I used audiencing to display a link to the 'restricted' page to selected users