Hello All,
This is regarding an odd behaviour of iggrid what i have noticed while implementing multicolumn header [ two or more column with single column header] feature in ignite ui iggrid.
I have a employeeList with following columns : EmpNo,First Name,Last Name,Salary, Is Active.
Now I have to make a iggrid with following header:Employee Number, First Name,Last name, Salary.But under first column header following three columns needs to be shown:
1) checkbox to select a row,
2) image base on active or not
3)Employee Number
While implementing multicolumn header in my iggrid i am getting following jquery error "Unable to get the value of rowspan. object is null or undefined".
If I remove that feature I am getting following jquery error: "Unable to get the value of group. object is null or undefined".
Following is the sample code snippet:
<script src="~/Scripts/jquery-1.10.2.js" type="text/javascript"></script>
<script src="~/Scripts/jquery-ui-1.10.4.js"></script>
<link href="~/IgniteUI/css/structure/infragistics.css" rel="stylesheet" />
<link href="~/IgniteUI/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link href="~/IgniteUI/css/structure/jquery.ui.theme.css" rel="stylesheet" />
<script src="~/IgniteUI/js/infragistics.core.js"></script>
<script src="~/IgniteUI/js/infragistics.lob.js"></script>
Ajax call:
$.ajax({ url: '@Url.Action("LoadEmployee", "Employee")', type: "POST", data: { empNo: $("#txtEmployeeNo").val() }, async: false, cache: false, success: function (data) { var empData=[]; var image = '@Url.Content("~/Images/ActiveImage.jpg")'; for (var i = 0; i < data.employeeList.length; i++) { debugger; var empRow = {}; var item = data.employeeList[i]; if(item.isActive=="Y") { empRow.ActiveImage ='<input type=\'image\' id=\'imgActive\' src=\'' + image + '\' style=\'width: 14px; height: 14px; visibility:visible\' />'; } else { empRow.ActiveImage ='<input type=\'image\' id=\'imgActive\' src=\'' + image + '\' style=\'width: 14px; height: 14px; visibility:hidden\' />'; } empRow.IdCheck='<input type="check" id="chkEmployee"'+i+' />'; empRow.EmpNo = (item.EmpNo + "").trim(); empRow.EmpFirstName = (item.EmpFirstName + "").trim(); empRow.EmpLastName = (item.EmpLastName + "").trim(); empRow.EmpSalary = (item.EmpSalary + "").trim(); empData.push(empRow);
}
$('#tblEmployee').igGrid({ autoGenerateColumns: false,
columns: [ { headerText: "Employee Number", group: [ { headerText: "", key: "IdCheck", dataType: "CheckBox", width: "25px" },
{ headerText: "", key: "ActiveImage", dataType: "image", width: "25px" },
{ headerText: "", key: "EmpNo", dataType: "string", width: "100px" }, ]
},
{ headerText: "First Name", key: "EmpFirstName", dataType: "string", width: "100px" }, { headerText: "Last Name", key: "EmpLastName", dataType: "string", width: "100px" }, { headerText: "Salary", key: "EmpSalary", dataType: "string", width: "200px" }, ], dataSource: empData, height: "400px", width: "550px", features: [
{ name: 'Sorting', type: "local" }, { name: 'MultiColumnHeaders' },
]
});
Please help me to resolve this issue.
Regards,
Biswajit
Hello Biswajit,
I made a sample on my side to test your scenario and I was unable to reproduce. However I noticed in your code that you're setting datatypes that correspond to the column's content into the multi column headers group, which is in conflict to the supported datatypes of igGrid columns: http://help.infragistics.com/jQuery/2014.2/ui.iggrid#options:columns.dataType
Please try to use templates image column and set its datatype to "string and set datatype: "bool" to the checkbox column and use format: "checkbox".
If you still encounters any problems, feel free to contact me.
Tsanna
Hello Tsanna
Thank you for the update,
I have used simple iggrid without any checkbox and image but facing the same issue.
These are the scenarios when I am getting the error:
1)When I am implementing Ig grid in separate window.(Window popup)
2)Without implementing multicolumnheader , IsMultiColumnHeader is getting set to true.I am not getting why this scenario is occuring.
I am able to use IgGrid in normal page , But when I am trying to open it from separate window I am facing this issue.
Please let me know in case of further clarification and help me to resolve this issue.
Could you provide me with working sample that reproduces the issue? It would be more helpful for me to take a look at your code in order to assist you further.
Looking forward to your response.
Hello Tsanna,
Thanks for your update.
I am very sorry I cant provide the working sample as it is against company policy.
For that reason, I have created dummy sample to reproduce the issue.
I want to tell I have used the same in other pages and it is working fine . But when I am trying to open an igGrid in another window, I am facing this issue(using javascript window.open()).
Also I saw in my jquery list(data that is getting fetched on ajax call) it is showing some events as well as the values.
Please revert back for further clarification.
Thanks
It seems that the sample didn't attach properly. Please note that you can attach only zipped files. Another reason for the rejected attachment could be that the size of the file exceeds the maximum allowed. Please try again and let me know if you have any difficulties.
Did you manage to resolve your issue? If you need further help, please let me know.