1

1.When i use keyboard up arrow it should highlight a move to up row and if i press down arrow the high light should move to down row

2.If i use uparrow or down arrow along with ctrl ,i should be able to multi select.

Here i have wrote code if i keep pressing up arrow it is continuing selecting and down arrow it is deselecting but i want do as what i mentioned above [http://jsfiddle.net/hKZqS/2/]

1 Answer 1

1
switch(e.which) { // user presses the "a" key case 38: if(!e.ctrlKey) $('tr').removeClass('ui-selected'); $('tr#'+(clickid-1)).attr('class', 'ui-selected'); clickid = clickid-1; break; // user presses the "s" key case 40: if(!e.ctrlKey) $('tr').removeClass('ui-selected'); $('tr#'+(clickid+1)).attr('class', 'ui-selected'); clickid = clickid+1; break; } 

you'll also have to check if clickid is > 0 and < tr count.
http://jsfiddle.net/hKZqS/8/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.