From ff970e60308d19534a1a991c47da78d3603f3d04 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 18 Jul 2010 08:56:02 -0400 Subject: [PATCH] Use more reliable multiple select instead of checkboxes. I couldn't figure out how to use setCellValue to change and display the checkbox values. The current implementation adds a "Set Tags" button which reads off the selected rows and uploads any tag changes. Problem with the current implementation: When the tree is rebuilt following a data refresh, the rebuild seems to unselect any repainted rows. I'm not sure why. The current workaround is to run setup_checkboxes() some reasonable delay after refreshing the data. Too bad I can't find a blocking refresh, or better yet, a post-refresh hook to use instead of setTimeout(). Anyhow, any tag selection activity by the user that happens during the timeout will, obviously, be overwritten by the setup_checkboxes() call. --- static/dirtag.js | 42 ++++++++++++++++++++++++++++++------------ template/dirtag.xul | 18 +++++++++++------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/static/dirtag.js b/static/dirtag.js index b6f5373..a51198d 100644 --- a/static/dirtag.js +++ b/static/dirtag.js @@ -38,12 +38,13 @@ function tag_in_tags(tag, tags) { function setup_checkboxes(tags) { var tree = document.getElementById('checkbox-tree'); - var ctags = tree.columns.getLastColumn(); for (var row=0; row + + ]> @@ -110,17 +112,20 @@ - + - - @@ -129,7 +134,6 @@ - -- 2.26.2