From: W. Trevor King Date: Sun, 18 Jul 2010 12:56:02 +0000 (-0400) Subject: Use more reliable multiple select instead of checkboxes. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ff970e60308d19534a1a991c47da78d3603f3d04;p=dirtag.git 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. --- 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 @@ -