Clarity

 View Only
  • 1.  Can we disable sorting by users in a Grid portlet?

    Posted Sep 15, 2015 01:26 AM

    Hi Friends,

     

    We have a query-based grid portlet. We don't want the users to change its sorting order from what we have already set under List Column Section>>Layout>>Column Sorting section in the portlet configuration. But, any user, who has Portlet-View access, can change the sorting order by clicking on the column headers of any of the fields in this grid portlet.

     

    Is there any way (supported/not) we could remove this sorting option given to all the portlet users? Please share your thoughts on this.

     

    Regards,

    Georgy



  • 2.  Re: Can we disable sorting by users in a Grid portlet?

    Posted Sep 15, 2015 04:04 AM

    Georgy,

     

    I don't think there will be an easy way.. ottb there isn't any options.

    here's the request from the browser when a sort is called, might be of use. Looks like you'd end up braking it for all portlets.

     

    uitk.vxml.form=1&action=npt.gridSetPageOrSort&ajax=true&grid_time_period_scroll=false&page_id=npt.overview&portlet_instance_id=5442001&grid_page=0&grid_sort_col=project_name&grid_sort_dir=asc&componentId=&ui.page.space=npt.overview&ajax.idAndParams=npt.overview

     

    maybe raise an idea for this functionality?



  • 3.  Re: Can we disable sorting by users in a Grid portlet?
    Best Answer

    Posted Sep 15, 2015 10:59 AM

    If you're standardized on using other browsers than IE, the following CSS added to your themes might work:

     

    a[href*='gridSort'][href*='page_5028002'] {pointer-events:none; cursor:pointer;}

     

    You would want to change the second selector ('page_5028002') to your own respective portlet.  To choose this value above (and so you can choose the correct value in your own situation), I did the following:

     

     

    By hovering over one of the columns on the portlet and viewing the status-bar where the javascript link action was displayed, you'll see I could put selectors on the gridSort method and then another identifier to limit the results to this portlet.  I did it this way, because trying to add additional quotes from the javascript invocation into the CSS was causing it to break for me and I didn't spend long enough to fix why that was happening when this other method appeared to suffice.

     

    This method (overriding 'pointer-events' in CSS) only works in IE11 and above though (whilst also running in IE11 standards mode, and current versions of Clarity are using IE10 or IE8 enterprise modes, so this CSS feature isn't implemented/available yet even when running IE11).  Other browser vendors, so long as they're updated, I believe should handle this.



  • 4.  Re: Can we disable sorting by users in a Grid portlet?

    Posted Sep 15, 2015 11:07 AM

    Nick,

     

    This is awesome and yes this works in ie11, chrome and firefox

    I completely forgot we have access to the css themes now, I've shared some other "fixes" before

    Maybe this and the others could be a future Tuesday tip!



  • 5.  Re: Can we disable sorting by users in a Grid portlet?

    Posted Sep 15, 2015 03:23 PM

    I think there is a caveat to that. If the portlet is on a user configurable page, and the user moves the portlet within the layout, the page_5028002 bit will be changed for that user.



  • 6.  Re: Can we disable sorting by users in a Grid portlet?

    Posted Sep 15, 2015 04:04 PM

    In that case a different set of selectors such as an 'A' anchor element with a 'gridSort' containing href that is also a child of other elements where you can more accurately pinpoint a specific value (for example the 'form' element is among the parents of the anchor, from which other identifying pieces of data can be exposed with its own child element containing the portlet id (not the instance id) you wish to apply this to..

     

     

    Certainly raising an Idea to have this implemented as a feature would be a whole lot nicer and easier to use, but until then it would require quite a bit of CSS creativity to pull off.  I'm not sure the selectors exist to pull that off just yet, and have edited this reply to try and reflect that.



  • 7.  Re: Can we disable sorting by users in a Grid portlet?

    Posted Sep 16, 2015 01:38 AM

    Hi Nick,

     

    Thanks a ton for your CSS workaround. We tested this in our UAT environment and it works perfectly . We also switched off the Personalizable option for that particular page tab to avoid changes to the page_XXXXXXX bit.

     

    Anyway, it's far better to have an OOTB option for something like this, rather than adding custom CSS code to our themes. So we have raised the following idea. Please vote up. Let's hope CA will have this implemented soon

     

    Option to disable sorting by users in a Grid portlet

     

    A big thanks to all for your inputs,

    Georgy



  • 8.  Re: Can we disable sorting by users in a Grid portlet?

    Posted Jul 07, 2016 11:10 AM

    Can you post your CSS here. I have a portlet that is displayed on a tab within each project, therefore the PageXXXX is always different, and I am still not sure what CSS syntax to use to accomplish this goal.

     

    Thanks