This example demonstrates how to specify a function to be executed when a data grid column header is clicked. This event is called onDataColumnClick. Once the event is activated, the function that will be executed for this event will receive 2 parameters: column id and field reference.
Syntax: myGrid.onDataColumnClick = function myFunction(column, fieldReference);
In this example, a function named onColumnClick is assigned to the onDataColumnClick event. When a column header is clicked, the information about the clicked column will appear at the bottom on the Grid area.
function onColumClick (column, fieldReference){
var info1 = createTR('Column ID', column);
var info1 = createTR('Field Alias', fieldReference.fieldalias);
var info2 = createTR('Field ID', fieldReference.fieldid);
var info3 = createTR('Field Type', fieldReference.fieldtype);
var info4 = createTR('Field is searchable', fieldReference.fieldsearchable);
$('myclicked').innerHTML = '<center><table>' + info1 + info2 + info3 + info4 + info5 + '</table></center>';
}
Note: The event onDataColumnClick can be activated before or after the DataGrid object is constructed (through go command).