Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 JQGrid
I am using below javascript for showing account numbers as masked type(e.g: 1234567890 is my account number. it will show like XXXXXX7890 in grid). I want to show full account number when mouse over to that account number like 1234567890. when mouse out from account number again need to show masked account number like XXXXXX7890.
 
$(document).ready(function () {
 
LoadJqGrid();
 
});
 
function LoadJqGrid() {
 
var fromDate = $('[id$=hdnStartDate]').val();
 
var toDate = $('[id$=hdnEndDate]').val();
 
if (fromDate == null) {
 
fromDate = '';
 
}
 
if (toDate == null) {
 
toDate = '';
 
}
 
jQuery("#jqgridViewReports").jqGrid({
 
url: '/Handlers/ReportsHandler.ashx?t=s&fromDate=' + fromDate + '&toDate=' + toDate + '',
 
datatype: 'json', mtype: 'GET',height: 'auto',headertitles: true,
 
colNames: ['AccountNumber','AccountHolder Name', 'FullAccountNumber'],
 
colModel: [ { name: 'AccountNumber',index: 'AccountNumber',width: 120,align: 'left',sortable: true,editable: false,resizable: true,edittype: "text",
 
cellattr: function (rowId, val, rawObject, cm, rdata) {
 
return 'title="' + rawObject.test + '"';}},
 
{ name: 'AccountHolder Name', hidden: true, key: false },
 
{ name: 'test', index: 'test', hidden: true },
 
],
 
caption: "View Report",
 
rowNum: 50,
 
width: '100%',
 
hidegrid: false,
 
ignoreCase: true,
 
emptyrecords: 'There are no records',
 
loadonce: true,
 
rowList: [5, 10, 20, 50],
 
viewrecords: true,
 
pager: '#navViewReports',
 
gridComplete: function () { },
 
loadComplete: function () { }
 
}).navGrid('#navViewReports', { search: true, edit: false, add: false, del: false })
 
};
 
In ReportsHandler i am using below code
 
private System.Data.DataTable FormattedDataTable()
 
{
 
System.Data.DataTable dtSummary = (DataTable).GetViewReport(FromDate, ToDate);
 
System.Data.DataTable dt = ConstructDataTable();
 
string maskchar = "XXXXXXXXXXX";
 
string fullAccountNumber = "";
 
if (dtSummary.Rows.Count > 0)
 
{
 
foreach (System.Data.DataRow drow in dtSummary.Rows)
 
{
 
DataRow dr = dt.NewRow();
 
dr["DecisionID"] = drow["DecisionID"];
 
fullAccountNumber = drow["AccountNumber"].ToString();
 
dr["AccountNumber"] = maskchar + fullAccountNumber.Substring(fullAccountNumber.Length - 4, 4);
 
dr["AccountHolderName"] = drow["AccountHolderName"];
 
dr["FullAccountNumber"] = drow["AccountNumber"];
 
dt.Rows.Add(dr);
 
}
 
}
 
return dt;
 
}
 

 
private DataTable ConstructDataTable()
 
{
 
DataTable dt = new DataTable();
 
dt.Columns.Add(new DataColumn("DecisionID"));
 
dt.Columns.Add(new DataColumn("AccountNumber"));
 
dt.Columns.Add(new DataColumn("AccountHolderName"));
 
dt.Columns.Add(new DataColumn("FullAccountNumber"));
 
return dt;
 
}
 

 
but mouseover on accountnumber shows 'undefined'.
 
Please help me to resolve this problem.
 
Thanks in advance.
Posted 5-Jul-13 15:39pm
Saibaby159

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 215
1 George Jonsson 175
2 Kornfeld Eliyahu Peter 159
3 PIEBALDconsult 110
4 Richard MacCutchan 85
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 5 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100