Backend link in gridview

Posted by Community Admin on 04-Aug-2018 10:18

Backend link in gridview

All Replies

Posted by Community Admin on 19-Aug-2013 00:00

Hello,
I have one question. I want to create link, which have id in url. So I wrote ClientTemplate and found out that fields sintax doesn't work in attributes. So I wrote some javascript to overcome the problem.
Is there a better solution for this?

01.DataColumnElement exportColumn = new DataColumnElement(gridMode.ColumnsConfig)
02.           
03.               Name = "Id",
04.               HeaderText = Res.Get<Labels>().Export,
05.               ClientTemplate = "<span data-id='Id'><span style='display:none'>Id</span><a onclick='var $this=$(this); $this.attr('href', $this.attr('href').replace('Id', $this.parent().children('span:not(:visible)').html() ) )' href='/" + ExportService.BaseUrl + "Id/ExportApplications'>Export</a>Id</span>",
06.               HeaderCssClass = "sfRegular",
07.               ItemCssClass = "sfRegular"
08.           ;
09.           gridMode.ColumnsConfig.Add(exportColumn);

Posted by Community Admin on 21-Aug-2013 00:00

Hello Mitja,

 Thank you for the sample.

I couldn't think of a better way personally but I will pass your concern about the syntax in attributes to the development team as a suggestion.

Regards,
Patrick Dunn
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed