3.2.0

Carlos please try and answer...

In the thread "Deleting a row" there is a question on how to set an onkeyup event. I've also tried onkeyup but it does not work. Is there ANY possibility you could help? Alex is out of the office this week and I need an answer ASAP

THANKS
AcidRaZor
March 1,
Let me try, I'll answer you tomorrow.
Carlos
March 1,
Anyway, you can try to modify a func. I found on a JS-Forum I post in:
http://activewidgets.com/javascript.forum.3152.9/drop-down-editable-textarea-template.html

I couldn't review it untill tomorrow morning, so If you are success, let me know.
Here is the function

editarea.setEvent("onkeydown", function(item){
tabspace = " "; //tab space
onespace = " "; //single space for Enter or other key
if(event.keyCode==9){
item.selection=document.selection.createRange(); //cursor location
item.selection.text=tabspace; //insert at cursor location
event.returnValue = false; }
if(event.keyCode==13){
item.selection=document.selection.createRange(); //cursor location
item.selection.text=onespace; //insert at cursor location
event.returnValue = false; }
} );

Best,


Carlos
March 1,
Unfortunately that doesn't work. obj.setEvent("onkeydown",null) works to disable all onkeydown strokes, but obj.setEvent("onkeydown",alert("something")) does not work on any keydown event.

Could it be a restriction within the class somewhere? That it captures all onkeydown events if it's not specifically set to null as in the first example? Then whenever it's an arrow button or whatever, navigates the grid?

I've written a multicolumn filter. Will release the code as soon as I'm happy with it. Still need to figure out how to hide the row count on the extreme left hand side
AcidRaZor
March 2,
Any possibilities to do this?i also need a better solution for this
romald
March 30,

Not sure if this is what you need,
Maybe the missing thing is, that need to call a function inside keydown-event to recover row-count and then refresh?

Notes:
- Need a row selection (click on any row)after every keydown (ins. or del.)
(not tested if is not neede enabling arrow key-navigation)
-ins. key duplicate (clone) the row selected.

Put this two fuctions inside any sample to test it:
////////////////////////////////////////////////////////
obj.setEvent("onkeydown", function(item){
//insert a row
if(event.keyCode==45){
var TEMPROW = new Array(obj.getColumnCount()) ;
TEMPROW = myData[obj.getSelectionIndex()];
obj.setSelectionIndex(0);
myData.unshift(TEMPROW);
resetRowValuesGrid1();
obj.refresh();
event.returnValue = false; }

//delete a row
if(event.keyCode==46){
myData.splice(obj.getSelectionProperty("values"),1);
resetRowValuesGrid1();
obj.setSelectionIndex(0);
obj.refresh();
event.returnValue = false; }

} );

function resetRowValuesGrid1()
{
var datalen=myData.length;
obj.setRowCount(datalen);
var rowValues = [];
for(var i=0; i < datalen; ++i) { rowValues.push(i);}
obj.setRowProperty("values", rowValues);
obj.setSortProperty("index", null);
}

Carlos
March 30,

This topic is archived.

See also:


Back to support forum