Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147155 | Sep 3,2019 10:38 AM UTC | Sep 10,2019 09:02 AM UTC | JavaScript - EJ 2 | 5 |
![]() |
Tags: Grid |
var grid = new ej.grids.Grid({
dataSource: window.employeeData,
allowSelection: true,
selectionSettings: { cellSelectionMode: 'Box', type: 'Multiple', mode: 'Cell' },
dataBound:(args)=>{
grid.selectCell({ rowIndex: 0, cellIndex: 0 });
},
enableHover: false,
columns: [
{ field: 'EmployeeID', headerText: 'Employee ID', textAlign: 'Right', width: 135 },
]
});
grid.appendTo('#Grid');
|
Index.html
<script id="template" type="text/x-template">
<a id="temp" rel='nofollow' href="#" class='customTemplate' onclick='viewPatientDetail(this)'>${EmployeeID} </a>
</script>
<script>
function viewPatientDetail(args){
alert('Hi')
}
</script>
var grid = new ej.grids.Grid({
selectionSettings: { cellSelectionMode: 'Box', type: 'Multiple', mode: 'Cell' },
dataBound: (args) => {
grid.selectCell({ rowIndex: 0, cellIndex: 0 });
},
columns: [
{
headerText: 'Employee Image', textAlign: 'Center',
template: '#template', width: 150
}],
width: 'auto',
height: 359
});
grid.appendTo('#Grid');
document.getElementById('Grid').addEventListener('keydown', function (args) {
if (args.target.classList.contains('customTemplate') && args.keyCode === 13) {
args.target.click()
}
})
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.