3.0.0

How do I execute clicking on a specific cell through JS?

Specifically I'm trying to have a keyboard event (SpaceBar) excecute a click on a checkbox that is in the first column of the current row.

Sorry if this is a simple question but I'm new to this and just found this component a couple days ago.

By the way thanks for a great component.
Tim
May 10,
Sorry, Never mind. I found something that seems to work for what I need. If anyone has any comments on what I found they would still be appreciated. Thanks.

Here is what I am using:


document.getElementById(this.getRowTemplate(this.getSelectionProperty("index")).getItemTemplate(0).getId()).children[0].click()
Tim
May 10,
The grid has trapped keydown events inorder to move the row selection with the arrow keys. If you can live without this feature, you can reenable key down events by calling

grid.setEvent("onkeydown", null);


In which case you can use tab and spacebar keys for manipulating form elements as normal.

gbegley
May 10,
Thanks for the reply,

I'm actually keeping the default functionality and adding my own for specific keys with the following code:

var defaultEventHandler = obj.getEvent("onkeydown");

var myEventHandler = function(event){
if(event.keyCode==32){
document.getElementById(this.getRowTemplate(this.getSelectionProperty("index")).getItemTemplate(0).getId()).children[0].click();
}
else{
defaultEventHandler.call(this, event);
}
}
obj.setEvent("onkeydown", myEventHandler);
Tim
May 10,
You can replace
document.getElementById(template.getId());

with
template.element();
Alex (ActiveWidgets)
May 10,
i am new to this i cann't understand this please give me a example
jeeva
October 5,
how can i manipulate data grid using aero key
vikas chaturvedi (DELHI)
August 6,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.