Skip to content

Commit 62c9515

Browse files
committed
Added "onRowClick" event for context menu events on rows in the Table class. Also replaced "desc" attribute with "javaxt-table" css class.
1 parent 58cb8fb commit 62c9515

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/table/Table.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ javaxt.dhtml.Table = function(parent, config) {
202202
//Create main table
203203
var table, tr, td;
204204
table = createTable(parent);
205-
table.setAttribute("desc", me.className);
205+
table.className = "javaxt-table";
206206
setStyle(table, "table");
207207
me.el = table;
208208
addShowHide(me);
@@ -648,6 +648,10 @@ javaxt.dhtml.Table = function(parent, config) {
648648
row.get = getRowContent;
649649
row.set = setRowContent;
650650
row.onclick = selectRows;
651+
row.oncontextmenu = function(e){
652+
if (this.selected) this.selected = false;
653+
selectRows.apply(this, [e]);
654+
};
651655

652656

653657
//Create template as needed. The template is a collection of cells that

0 commit comments

Comments
 (0)