From 76181cd65afbdfd0ad63f07aaf049532013260c4 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Mon, 17 Aug 2015 10:39:57 +0000 Subject: [PATCH] SSDM-2340 : Support open on new tab for all javascript links. SVN: 34465 --- .../html/js/views/DataGrid/SampleDataGridUtil.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js index a891c0f01af..982948e3bf8 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js @@ -11,7 +11,21 @@ var SampleDataGridUtil = new function() { label : 'Identifier', property : 'identifier', isExportable: true, - sortable : true + sortable : true, + render : function(data) { + var href = Util.getURLFor(mainController.sideMenu.getCurrentNodeId(), "showViewSamplePageFromPermId", data.permId); + var link = $("<a>", { "href" : href, "class" : "browser-compatible-javascript-link" }).append(data.identifier); + return link; + }, + filter : function(data, filter) { + return data.identifier.indexOf(filter) !== -1; + }, + sort : function(data1, data2, asc) { + var value1 = data1.identifier; + var value2 = data2.identifier; + var sortDirection = (asc)? 1 : -1; + return sortDirection * naturalSort(value1, value2); + } }); if($.inArray("NAME", propertyCodes) !== -1) { -- GitLab