Click here to Skip to main content
11,581,186 members (63,036 online)
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 14: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 260
1 Frankie-C 145
2 Sergey Alexandrovich Kryukov 135
3 virusstorm 85
4 RyanDev 84
0 OriginalGriff 1,183
1 Sergey Alexandrovich Kryukov 825
2 Abhinav S 597
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 5 Jul 2013
Copyright © CodeProject, 1999-2015
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