This is a migrated thread and some comments may be shown as answers.
change column header url
1 Answer 15 Views
This is a migrated thread and some comments may be shown as answers.
Adam King
Top achievements
Rank 1
Adam King asked on 23 Jun 2020, 03:43 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Jun 2020, 01:42 PM

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.
Tags
Grid
Asked by
Adam King
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or