Ajax DataGrid Support Product Page

displayed data is a hyperlink to a file

Asked 30 Oct 2008 23:15:26
1
has this question
30 Oct 2008 23:15:26 Manuel Pena posted:
This what I have to do, I have a list of jobs displayed in the grid, the data source is a MS-SQL table, the table has a fileld named path, this field contains the path to the job description file, so I want either to click on the job description and then open a window with the corresponding job description or next to a job description have a button that reads "job description" when clicking on this button open a window with the corresponding jib description.

Is this possible with the AJAX data grid extension?

Replies

Replied 31 Oct 2008 10:51:16
31 Oct 2008 10:51:16 Miroslav Zografski replied:
Hi Manuel,

Yes, it is possible. What you need is to go to the advanced edit pop-up of data grid, in connection tab. There you must select the column in which you want to add a link to your file. Then in Content before you must add a link tag like the following:
<a href="{nameofthecolumn}" target="_blank">
and in content after add :
</a>
That way the content of the cell will become hyperlink which is pointing to cell's content
{nameofthecolumn} is passing the value of the column and can be used for referring datagrid values.

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 31 Oct 2008 19:39:41
31 Oct 2008 19:39:41 Manuel Pena replied:
Miroslav,

I am having little trouble following your instructions, in the AJAX data Grid I only have the following tabs: HTML, Contents, Details, Translation and About, I dont see any tab labeleed "Connection"

Regards

ManuelP
Replied 03 Nov 2008 09:34:37
03 Nov 2008 09:34:37 Miroslav Zografski replied:
Hi Manuel,

My mistake. The right tab is Contents.

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 22 Apr 2010 07:22:20
22 Apr 2010 07:22:20 Jeff Spijkers replied:
I am trying to do the same thing but it it broke my datagrid completely and I cannot fix it.

I have a grid which shows a list of pdf files. All I want to do is allow users to click a file name and download the pdf.

I have tried your suggestions and it broke the datagrid... I only get an error message saying that the grid received an error response from the database.[v]

Removing the before and after content in an attempt to revert to the previous state continues to generate the same error. I had to completely delete the grid from the page and rebuild a new grid.

Am I doing something wrong?[?]
Replied 22 Apr 2010 11:18:40
22 Apr 2010 11:18:40 Miroslav Zografski replied:
Hello Jeff,

I see now that the special chars are translated in browser friendly code.

what I meant there was as follows:

before:
    <a href="{nameofthecolumn}" target="_blank">

after:
</a>

where nameofthecolumn is the name of the column that is set in the database and the column that contents a hyper link.

Regards,
Replied 23 Jan 2011 00:53:37
23 Jan 2011 00:53:37 David A replied:
I am still cannot fiquire HYPERLINK-TO-MASTER PAGE out in ASP:
Can i get more detail in code the following:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="949"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="../Styles/dmxGrid/dmxgrid/dmxgrid.css" />
<script language="javascript" type="text/javascript" src="../ScriptLibrary/jquery-latest.pack.js"></script>
<script language="javascript" type="text/javascript" src="../ScriptLibrary/flexigrid.pack.js"></script>
<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'";
}

function controlAjaxDataGrid(scope, id, action) {//v1.3
var j = window.$ || null, scope = scope || document;
if (scope != document && scope.document) {
j = scope.$ || null;
scope = scope.document;
}
if (!j) return;
var tgt = scope.getElementById(id);
if (tgt && tgt.grid) {
switch (action) {
case 'reload' :j('#' + id, scope).flexReload();break;
case 'goToPage' :tgt.grid.changePage(arguments[3] || '');break;
case 'setFilter':
if (arguments[3] && arguments[3] == 'custom') {
j('#' + id, scope).setFilter(
arguments[4] || '',
arguments[5] || '',
arguments[6] || ''
);
} else if (arguments[3] && arguments[3] == 'form') {
j('#' + id, scope).setFilter(
arguments[4] || '',
arguments[5] || '',
arguments[6] ? $(arguments[6]).val() : ''
);
}
break;
}
}
}
//-->
</script>
</head>

<body>
<div class="dmxgrid">
<script type="text/javascript" language="javascript">
<!--
$(function(){$('#dmx_grid2').flexigrid({
url: "../ajax_servers/dmx_grid1.asp",
rp: 20,
title: "Search List",
floatingSearch: true,
showSearchOnLoad: true,
nowrap: false,
showToggleBtn: false,
sortorder: "ASC",
novstripe: true,
dataType: "json",
rpOptions: [5, 10, 15, 20, 25, 30, 35, 40, 45, 50],
onrowmousedown: "",
onrowmouseup: "",
onrowmouseover: "",
onrowmouseout: "",
onrowclick: "",
onrowdblclick: "",
colModel: [{
display: "Username",
name: "Username",
width: 100,
sortable: true,
align: "left",
hide: false
},
{
display: "Age",
name: "Age",
width: 100,
sortable: true,
align: "left",
hide: false
},
{
display: "State",
name: "State",
width: 100,
sortable: true,
align: "left",
hide: false
},
{
display: "City",
name: "City",
width: 100,
sortable: true,
align: "left",
hide: false
},
{
display: "Marrital Status",
name: "Marrital_Status",
width: 100,
sortable: true,
align: "left",
hide: false
},
{
display: "Occupation",
name: "Occupation",
width: 100,
sortable: true,
align: "left",
hide: false,
onclick: "MM_goToURL('parent','detail3.asp');"
}],
searchitems: [{
display: "Occupation",
name: "Occupation",
isdefault: true
}]
});});
//-->
</script>
<table id="dmx_grid2"><tr><td></td></tr></table>
</div>
</body>
</html>
Replied 23 Jan 2011 01:46:35
23 Jan 2011 01:46:35 David A replied:
I got it!
Replied 24 Jan 2011 10:51:22
24 Jan 2011 10:51:22 Miroslav Zografski replied:
Glad You make it David.

Regards,

Reply to this topic