change column header url

2 posts, 0 answers
  1. Adam King
    Adam King avatar
    32 posts
    Member since:
    May 2010

    Posted 23 Jun 2020 Link to this post

    Is there a way to hide/change the URL in a sortable column header in an ajax grid and keep the sorting ability?

    The URL is referring to the Read ajax action (with the sort direction)

    Page URL: http://mysite/Incident?FacilityID=123
    Header URL: http://mysite/Incident/Read?FacilityID=123&IncidentGrid-sort=IncidentSummaryFacilityTypes-asc

     

    Users are right-clicking the column header URL and opening in new tab/window which causes an error because it's calling an ajax grid read method, not a full page method.

    We want to keep the sorting but if possible change the URL so if opened in a new window it just reloads the same page. Our grid is setup using the ajax datasource read.Action and works fine other than this URL being visible/available for opening in new windows.

    The sorting demo has a different datasource, but works how we'd like: https://demos.telerik.com/kendo-ui/grid/sorting
    The column headers automatically link to the page, not to a different action.

     

    A secondary option is can we disable right-click on just the column headers.

  2. Dimitar
    Admin
    Dimitar avatar
    502 posts

    Posted 25 Jun 2020 Link to this post

    Hi Adam,

    As suggested in the following forum thread on the same topic, for this scenario it is recommended to prevent the contextmenu event and not allow opening the link in a new tab.

    Regards,
    Dimitar
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top