//-- //-- ListView gadget //-- var ListView = {}; // Create a listview //# place - where in the DOM tree to insert the listview //# listObject - array of objects to be included in the listview //# listTemplate - template for the listview //# callback - callback for a command being selected //# className - optional classname for the element ListView.create = function(place,listObject,listTemplate,callback,className) { var table = createTiddlyElement(place,"table",null,className || "listView twtable"); var thead = createTiddlyElement(table,"thead"); var t,r = createTiddlyElement(thead,"tr"); for(t=0; t element of listView //# callback(checkboxElement,rowName) //# where //# checkboxElement - DOM element of checkbox //# rowName - name of this row as assigned by the column template //# result: true if at least one selector was checked ListView.forEachSelector = function(view,callback) { var checkboxes = view.getElementsByTagName("input"); var t,hadOne = false; for(t=0; t