Hide "View Item" ribbon element using jquery or css

Hi,
How to hide "View Item" ribbon element using jquery for a single custom list?
In CEWP, i have tried this:
.ViewProperties.Manage.ListItem#Ribbon {
DISPLAY: none
But this is not hiding the "View Item" option.
How to achieve this?
Thank you

I have tried different CSS and Javascript tricks to hide this item but not successed,
Now one another solution i found is to used the SPRibbon.TrimById method,
So for that you need to create one webpart, and add following line of code to it , add this dll first Microsoft.Web.CommandUI.dll
public void HideRibbonItem()
SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
if (ribbon != null)
ribbon.TrimById("Ribbon.ListItem.Manage.ViewProperties");
Now call this function to the page load event of webpart,
Now add this webpart to that page instead of content editor webpart,
so it will hide the View Item form the custom list ribbon
Hiren Patel | Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

Similar Messages

  • Developer-Online: Create a Digg login style using jQuery and CSS

    Create a Digg login style using jQuery and CSS
    Hello Friend, today We'll see how to create a Digg Login panel using only CSS3 and a bit of jQuery script. You'll see how is simple present a login feature using a modal window creates by js. You'll find the .ZIP tutorial visiting: http://www.beatfly.com/download.php
    Tags:    tips & tricks | JS
    Author: patrizio Quatrini
    Posted: 2010-02-04 10:57:48
    Brought to you by: Developer-Online

    Thanks Leonard
    On the surface that looks a mighty powerful product that probably goes far beyond what we require. Looking at the system requirements, it seems that some specific Application Servers are needed (is this correct?), which we won't have. Am I correct in thinking this is a modular based product, in that I buy a base product (being LiveCycle ES ... not sure what this product does on it's own) and then add a module such as PDF Generator to it?
    It's difficult to glean from the product web site exactly what this product is all about but my gut feel is it'll be a few steps beyond what we need to achieve. I might be wrong, so feel free to pull me up there but it seems this is along the lines of a total back-end Adobe solution.
    If you have any other suggestions I'd be grateful, otherwise I may need to continue down the "clunky yet serviceable" HTML to PDF route
    Adrian 

  • View More Pop up using jquery

    Hi,
    In our requirement, there would be hyperlink ‘View More’ on all the cells of the row.
    After clicking ‘View more’ hyperlink data needs to be displayed.
    We are able to achieve this by using the below method.
    Private void methodname(DataTable dt,HtmlGenericControl divid)
    StringWriter sw = new StringWriter();
    HtmlTextWriter htw = new
    HtmlTextWriter();
    Int totalRowCnt = dt.Rows.Count;
    #write javascript to page
    #region write javascript to page
                htw.Write("<script type=\"text/javascript\">\n");
                htw.Write("$(document).ready(function()\n");
                htw.Write("{\n");
    for (int k = 0; k < totalRowCnt; k++)
                    htw.Write(string.Format("$(\"#viewmore{1}{0}\").click(function()\n",
    k, divid.ClientID));
                    htw.Write("{\n");
                    htw.Write(string.Format("$(\"#viewmore_det{1}{0}\").toggle(500);\n",
    k, divid.ClientID));
                    htw.Write("});\n");
                htw.Write("});\n");
                htw.Write("</script>\n");
                #endregion
    Now there is requirement change here i.e. after clicking ‘View More’ hyperlink on the next cell of the same row. The pop up of ‘View More hyperlink’ of the first cell should be hidden. PFA file for better understanding.
    For this I have written the code as below but it is not working.
    Please let me know if I am making any mistake
    Private void methodname(DataTable dt,HtmlGenericControl divid)
    StringWriter sw = new StringWriter();
    HtmlTextWriter htw = new
    HtmlTextWriter();
    Int totalRowCnt = dt.Rows.Count;
    #write javascript to page
    #region write javascript to page
                htw.Write("<script type=\"text/javascript\">\n");
                htw.Write("$(document).ready(function()\n");
                htw.Write("{\n");
    for (int k = 0; k < totalRowCnt; k++)
                    htw.Write(string.Format("$(\"#viewmore{1}{0}\").click(function()\n",
    k, divid.ClientID));
                    htw.Write("{\n");
                    htw.Write(string.Format("$(\"#viewmore_det{1}{0}\").toggle(500);\n",
    k, divid.ClientID));
    htw.Write(string.Format("$(\"#viewmore_det{1}{0}\").prev().hide();\n", k, divid.ClientID));
                    htw.Write("});\n");
                htw.Write("});\n");
                htw.Write("</script>\n");
                #endregion
    Thanks & Regards, Sudheer

    Hi,
    Would you mind providing the source code of your HTML page for a further research? It will make others easier to find out a solution to your issue.
    What’s more, it is recommended to debug your script in browser and log some information out when you perform the click event on the page, this will help you get more details
    about how your code works.
    Here are two similar demos for your reference:
    http://css-tricks.com/snippets/jquery/simple-jquery-accordion/
    http://jqueryui.com/accordion/
    Best regards
    Patrick Liang
    TechNet Community Support

  • Hide new item button in ribbon jquery

    hello,
    I need to hide new item button from list page through jquery.
    thanks.
    regards
    krishnakumar

    Another option is to hide them using CSS.
    SharePoint 2010 Hide Ribbon button using CSS
    Amit

  • How to hide lookup field which is having 20+ items using jquery?

    Hi All,
    I am able to hide the lookup field which is having less than 20 items using jquery, but unable to do it when it goes beyond 20 items.
    My code is for <20 is: $("select[title = 'Column-lookup']").closest("tr").hide();
    Thank You.
    Ramanjjilu Naidu

    Below code is working for me in all browser even with 24 lookup item
    <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.min.js"></script><script type="text/javascript">
    $(document).ready(function(){
    $('select[title="Column-lookup"]').closest("tr").hide();
    </script>​​​​​​ ​​​​​​<br/>​<br/>
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Iterating through List View Items using Group By and Jquery

    In my listview to my document library, I am using grouping. For each group (using month), it lists all the documents pertaining to that particular month.
    Using JQuery, I need to go through each item and parse them, but I'm having trouble finding a usable selector for the for/each function. My parsing code (JQuery) works, but since it uses the class of the table cell with a child anchor, it basically
    finds the first item and then all the subsequent file names are named the same (instead of different names, like it should be).
    Here's my current code that doesn't work (only the iteration and naming separately for each file - the parsing I'm doing seems to work):
    $(".ms-wpContentDivSpace" ).each(function( index ) {
    var val=$(".ms-vb2 a").html();
    var val2=val.replace(/_/g," ");
    $(".ms-vb2 a").html(val2);
    any ideas?

    That's because
    $(".ms-vb2 a").
    is bringing back all the pieces that have that class with an anchor on the whole page, not just the ones in the .ms-wpContentDivSpace
    I don't know the exact syntax, but I think you need to iterate through all the '.ms_vb2 a' items as well - there are multiple ones, and do something like this inside your other grouping
    $(".ms-vb2 a").each(function(index) {
        var val=$(this).html();
       var val2=val.replace(/_/g," ")
       $(this).html(val2);
    That's not quite right but maybe that will help.
    Robin

  • Is it possible to manipulate page viewer webpart using jquery on page?

    I have an aspx page onto which I have added a page viewer web part to display a powerpoint file. I wanted to hide or remove the close button because closing returns to the library in which the file lives, which is not the desired behavior.
    my first solution was to hide the close button using jquery using the following
    <html>
    <head>
    <script language="javascript">
    $(document).ready(function()
    alert("hello");
    $(".cui-topBar1").hide();
    </script>
    </head>
    </html>
    I am reasonably certain that this function is called before the page has rendered the page viewer web part, meaning that the html element of interest is not even on the page, which in turn would explain why the function does not do what I desire.
    is there a way to trigger this function after the web part is rendered? or, is there a way to intercept the close event or its redirection so that I can send the user to the desired page? Perhaps it is as simple as adding html to hide web part elements,
    but that has not worked either.
    the ideal solution is to manage page redirection on close or prevent powerpoint viewer closing.
    sharepoint 2013 sp1 enterprise farm, self hosted.

    Hi Tony,
    Thanks for sharing the information. Have a good day.
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • My photos always seem to look darker in photoshop elements than when I view them in windows photo viewer - and now I have purchased the annual contract for photography cloud they look exactly the same in PS CC6 as they do in photo viewer - but I still use

    My photos always seem to look darker in photoshop elements than when I view them in windows photo viewer - and now I have purchased the annual contract for photography cloud they look exactly the same in PS CC6 as they do in photo viewer - but I still use PS Elements 12 for some tasks and they still appear slightly darker in there - any ideas? - Regards Robert

    My photos always seem to look darker in photoshop elements than when I view them in windows photo viewer - and now I have purchased the annual contract for photography cloud they look exactly the same in PS CC6 as they do in photo viewer - but I still use PS Elements 12 for some tasks and they still appear slightly darker in there - any ideas? - Regards Robert

  • Create a tab view item in obj-c for use in applescript studio

    I'm making an application with applescript studio. I want to be able to add tab view items to a tab view at the press of a button. The problem I have is applescript studio doesn't allow me to create a new tab view item. So I'm thinking I can create the tab view item using objective-c, pass that to my applescript, then add it to my tab view.
    In applescript I plan to use the following call methods to first create the tab view item object, and then add it to my tab view. The objective-c code which is called from the first line in the applescript code is below that. When I run my code I'm getting an error saying newTVI is not defined... so maybe you can see my error! Be kind to me because I'm new to objective-c and I'm sure that's where my problem lies. Anyway, I'd appreciate any help.
    ==Applescript calls to create and add a new tab view item
    set newTVI to call method "returnNewTabViewItem" of class "makeNewTabViewItem"
    call method "addTabViewItem:" of objMainTV with parameter newTVI
    ==Objective-c code to create the tab view item
    ==makeNewTabViewItem.h==
    #import <Cocoa/Cocoa.h>
    @interface makeNewTabViewItem : NSTabViewItem
    NSTabViewItem *newTVI;
    -(NSTabViewItem *)returnNewTabViewItem;
    @end
    == makeNewTabViewItem.m==
    #import "makeNewTabViewItem.h"
    @implementation makeNewTabViewItem
    -(NSTabViewItem *)returnNewTabViewItem
    newTVI = [[[NSTabViewItem alloc] initWithIdentifier:nil] autorelease];
    return newTVI;
    @end

    Please, any ideas?

  • Rating a List Item using jquery with out using User profile service

    Hi,
    I dont have access to Central admin and i was not not able to enable USer profile service.
    can i rate a list item in Sharepoint 2010 using any jquery plugin
    i got the link
    http://blogs.msdn.com/b/carloshm/archive/2009/08/24/jquery-rating-in-sharepoint-lists.aspx
    But i am not able to find any plugin in it.
    Please advice.
    Thnaks,
    Pallavi

    Hi,
    According to your post, my understanding is that you wanted to rate a list item using JQuery in SharePoint 2010.
    The link you had posted above is for SharePoint 2007.
    You can refer to the following articles which about using the JQuery to call the rating service.
    http://blog.dennus.net/2011/08/09/using-spservices-and-jquery-to-include-social-rating-control-on-_layouts-page/
    https://www.habaneroconsulting.com/insights/Calling-the-Rating-Service-using-jQuery-in-SharePoint-2010-Part-1-of-2#.UxbQxvmSz6k
    You can also use the tool of the CodePlex to achieve it.
    http://sptoolbasket.codeplex.com/
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • HT4993 How do you view items that use flash player? Is it possible? Please & thank you

    How doyou view items that use flash player with an Iphone 4S. Is it possible?

    There is no Flash Player for iOS. Browsers on the App Store like Photon have flash capabilities.

  • Check user permission level using jquery/javascript

    On a sharepoint page I need to check permission level for a user and based on permission level he is having i need to hide few elements on that page.any pointers on how to check user permission level using jquery/javascript.
    for eg: i need to do something like this
    if(userpermissionlevel=="custom read"){//hide some elements}
    Any pointers will be helpful.

    Try below
    function checkifUserHasEditPermissions()
    context = new SP.ClientContext.get_current();
    web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.load(web,'EffectiveBasePermissions');
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
    function onSuccessMethod(sender, args)
    if (web.get_effectiveBasePermissions().has(SP.PermissionKind.editListItems))
    //User Has Edit Permissions
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/f21ad6b1-445a-497d-a286-d3ba8c2928a6/how-to-get-the-current-user-permission-level-on-a-list-item-with-ecmascript
    or
    http://stackoverflow.com/questions/22122139/check-if-current-users-belongs-to-sp-group-using-javascript-client-side-object-m
    http://blog.fidelityfactory.com/2011/11/29/sharepoint-client-ecma-script-check-user-permissions/

  • How to hide "View in Browser" and "Edit in Browser" from ECB injected by Office Web Apps Feature

    Hi,
    i am currently using custom_AddDocLibMenuItems to implement a custom ECB menu for my document library. I need to activate Office Web Apps. My custom_AddDocLibMenuItems has two items
    -> custom dialog
    -> open in office web apps
    After activating the Office Web Apps Feature at the SiteCollection Level, this Feature "injects" in my custom menu the following
    additional menu items:
    -> View in Browser
    -> Edit in Browser
    Its curious to see that, cause implementing the js function custom_AddDocLibMenuItems with
    return true should be the way to impolement a custom ECB menu without having other features/solutions injecting things in this menu!? Or did i misunderstood something here?
    My question is: How can i prevent this ...
    a) without deactivating the Office Web Apps Feature
    b) without modifying the core.js
    I hope someone can help!
    Best Regards
    Bog
    Developers Field Notes | www.bog1.de

    May be this can help
    http://extreme-sharepoint.com/2011/10/29/hide-menu-ecb/http://pholpar.wordpress.com/2011/07/24/hiding-ecb-custom-actions-based-on-specific-list-properties-using-the-client-object-model/Or tryhttp://stackoverflow.com/questions/13795858/how-to-hide-view-in-browser-in-document-library-in-sharepoint-2010-using-javascr $(document).ready(function(){
    $('.ms-MenuUIPopupBody').live('blur', function() {
    var elm = $("div.ms-MenuUIULItem a:contains('View in Browser')");
    elm.remove();
    $("div.ms-MenuUIULItem a:contains('Edit in Browser')").remove();
    It is hiding menu only on focus or blur or mouseover
    I wants it to be hide on load AS soon as i Click on "V" option on right side of document it should hide View in Browser and Edit in browser
    When I click on V option ![I wants As soon as i Click on v option right side of test it should hide view in Browser and edit in browser][1]
    If this helped you resolve your issue, please mark it Answered

  • Hide view links in list view in sharepoint 2013

    Hi
    How I can hide view links in list view in sharepoint 2013. Like below pic?
    Thanks.

    for that you can use id of its parent span element something like below.
    #WPQ2_ListTitleViewSelectorMenu_Container {
    display: none !important;
    Thanks.

  • How to hide menu item(Download a Copy...etc) of online site in sharepoint app according to different condition

    My requirement is that need to build a  sharepoint app, the app need to deploy to office store, whether to display "Download a Copy" according to different login in user(sharepoint office365 user), 
    click the  documnet, navigate to the other website,  after get the document stream, i need to convert the stream to the other data format(pdf...etc),  maybe i need the third-party dll to achieve it, so i think of sharepoint provider-hosted
    way to handle the requirement.
    i don't know whether there are the other way , if my way is the best, how to achieve it ?
    Thanks

    Hi,
    According to your post, my understanding is that you want to hide "Download a Copy" according to the user permissions.
    We can achieve it using jQuery and SharePoint REST API. Use REST API to check user permissions, then hide "Download a Copy" like this:
    $("A[id$='Ribbon.Documents.Copies.Download-Large']").hide();
    http://www.lifeonplanetgroove.com/checking-user-permissions-from-the-sharepoint-2013-rest-api/
    For other questions, I would suggest you post it in a new thread, it would make others easier to focus on one question in one single thread and it will benefit other community members who stuck with the same question.
    Best Regards
    Dennis Guo
    TechNet Community Support

Maybe you are looking for