Closed arj-ary closed 8 years ago
just using:
{
field: 'Attachment',
cellTemplate: '<a href="{{ row.branch.data_attachment }}">Name File</a>'
}
Good Luck. P/S: I missed {{ }}
Hi @thienhung1989 ,
Thanks for the guidance. But how do i display the name of the file instead of " Name File "?. The name of the file is present in the form of JSON as show below. So i need to access the JSON field in cellTemplate. Please help ! Please see below -
var rawTreeData = [ { "DemographicId": 1, "ParentId": null, "Name": "Test Correspondence", "Attachment":"Doc1.pdf", "From": "Arjun Balaji", "To": "Rodney Clark", "Date": "04/07/2014", },
@arj-ary You can use the following code snippet:
cellTemplate: '<a href="{{ row.branch[col.field] }}">{{ row.branch['field_name'] }}</a>'
where field_name
is the name of the field you want to access directly, say "Name".
Hi @diosney ,
Thank you, it worked. However i am not able to access give a value in the href field. The value is in the JSON format by field name "link". When i click on the link it navigates to a FileNotFound exception page. Please see below on how i am trying to access the link value, i am trying to click on the highlighted field.
var rawTreeData = [ { "DemographicId": 1, "ParentId": null, "Name": "Test Correspondence", "Attachment":"doc1.pdf", "link":"www.google.com", "From": "Arjun Balaji", "To": "Rodney Clark", "Date": "04/07/2014", },
One other things you may want to try is to change href
for ng-href
and prepending http://
to the link href
attribute like this:
<a ng-href="http://{{ row.branch['link'] }}">test</>
If this not work for you, can you set up a jsfiddle or an example page for me to check it?
Is this still outstanding, or can I close it?
Closing due to lack of activity.
Hello,
I have used tree-grid and i am very happy with the way it has turned out, however i am right now stuck at this point where i have show links on the rows, basically on one of the td vales. I am not able to do that since we can't provide html tags in the JSON data. Could you please advise on how i can do that ?
Thanks in advance,