Hi,
I am creating a data application where users must be able to select table rows to perform actions on it... Think in terms of Yahoo Mail. I have written a script to select clicked rows and to deselect them when clicked again. I also added shift button functionality and 'escape' to deselect all.
However my problem arise with my click and drag to select multiple rows. It works fine in FF and IE, I have managed to disable text select in these browsers because it looks awry, but have not managed to achieve the same effect in Opera.
Anyone know how perhaps?
Here's my JavaScript code:
ThanksCode:function init() { if (!document.getElementById) return; addEvent(document, 'keydown', aKeyWasPressed, false); addEvent(document, 'keyup', aKeyWasReleased, false); addEvent(document, 'mousedown', setMouseDown, false); addEvent(document, 'mouseup', setMouseUp, false); var browseTable = document.getElementById('browse'); for (var i = 0; i < browseTable.rows.length; i++) { browseTable.rows[i].onselectstart = function() {return false;}; browseTable.rows[i].unselectable = "on"; browseTable.rows[i].style.MozUserSelect = "none"; browseTable.rows[i].style.cursor = "default"; addEvent(browseTable.rows[i], 'mousedown', selectRow, false); addEvent(browseTable.rows[i], 'mouseover', getMouseDown, false); selectedRows[i] = false; } }![]()








Bookmarks