Hi,
I have a grid and i need to set hyperlink for three columns and also I have these column font color change depend on the column value... How do i do that..
here is my Index.cshtml
My Functions to change the column color..
I need to set hyperlink like this "href=/#=FileType#/Index?Batchno=#=BatchNo" on all three columns...along with color change rule..
I have a grid and i need to set hyperlink for three columns and also I have these column font color change depend on the column value... How do i do that..
here is my Index.cshtml
columns: [ { field: "BatchNo", width: "150px" }, { field: "BatchDate", width: "250px", format: "{0:dd-MMM-yyyy hh:mm:ss tt}", parseFormats: ["yyyy-MM-dd'T'HH:mm:ss.zz"] }, { field: "FileType", width: "250px" }, { field: "BatchFileName", width: "600px" }, { field: "BatchRecords", title: "StageCount", width: "150px", template: "\u003cb\u003e\u003ca href=\u0027/#=FileType#/Index?Batchno=#=BatchNo#\u0027\u003e#=BatchRecords#\u003c/a\u003e\u003c/b\u003e" }, { field: "LoadCount", width: "150px", template: '#=SetLoadColor(BatchRecords,LoadCount,ReportCount)#' }, { field: "ReportCount", width: "150px", template: '#=SetReportColor(BatchRecords,LoadCount,ReportCount)#' }, { field: "Status", width: "150px", template: "#=Status#", editor: statusDropDownEditor }, { field: "EntityCode", width:"150px" }, { field: "EntityName", width:"150px" }, { field: "CreatedBy", width:"200px" }, { field: "CreatedDate", width:"250px", format: "{0:dd-MMM-yyyy hh:mm:ss tt}", parseFormats: ["yyyy-MM-dd'T'HH:mm:ss.zz"] }, { field: "ModifiedBy", width:"350px" }, { field: "ModifiedDate", width:"250px", format: "{0:dd-MMM-yyyy hh:mm:ss tt}", parseFormats: ["yyyy-MM-dd'T'HH:mm:ss.zz"] }, { command: ["edit"], title:" ", width:"200px"}], editable: "inline", pageable: true, sortable: true, filterable: true, columnMenu: true, resizable: true,My Functions to change the column color..
function SetLoadColor(BatchRecords,LoadCount,ReportCount){ if(BatchRecords===LoadCount||LoadCount===0 ) return LoadCount; else return "<font color=\"red\">"+LoadCount+"</font>";}function SetReportColor(BatchRecords,LoadCount,ReportCount){ if(BatchRecords===ReportCount&&LoadCount===ReportCount||ReportCount===0 ) return ReportCount; else return "<font color=\"red\">"+ReportCount+"</font>";}I need to set hyperlink like this "href=/#=FileType#/Index?Batchno=#=BatchNo" on all three columns...along with color change rule..