Jump to content

Collapsible Sets Of Check Boxes?


Recommended Posts

So I have xplode up and running and I really like the checkbox mode. I was wondering if it were possible to make it so different sets of check boxes were hideable...cuz after you get a bunch of stuff in there it starts to become unwieldy...

I know how to do this with DHTML, but I don't really understand how html/javascript works with xplode...like, can I just go editing the html files that came with it and expect that to work?


Link to comment
Share on other sites

Try it and see.

All the selection plugin is doing is embedding an IE window, so DHTML stuff should work fine.

The ones included were only hacked together, so it's as basic as I could make them - I'm sure people could do a LOT more with it - I haven't done much with Javascript etc.

If you can make something that's good, be sure to attach it here for other peoplet o use.

Link to comment
Share on other sites

I'm trying my little heart out to get it working right now...but for some reason it keeps telling me the object isn't there...I'm using the exact same code I've used in other projects...i have no idea why it wouldn't work...

Link to comment
Share on other sites

ok here's how it's done...have to add one new function that will toggle the visibility:

function toggleDiv(itemno) {
 var tags = window.external.GetTagCount(itemno);
 for(var j = 0; j < tags; j++) {
   var temp = "document.all.blah" + itemno + "blah" + j + ".style.display";
   if (eval(temp)=="none") { eval(temp + "='block'"); }
   else { eval(temp + "='none'"); }

Then need to modify another function or two:

function addTag(text, itemno, tagno)
 // retrieve this tag's attributes
 var disp = window.external.GetTagAttr("display", itemno, tagno);
 var checked = window.external.GetTagAttr("checked", itemno, tagno) == "true" ? "checked" : "";

 // set up the current tag's layout stuff - name of checkbox ends up being item4.tag2 etc.

 // Changed by eMpTy to give each row containing a checkbox a unique id.
 text += "<tr class='effectrow' id=\"blah"+itemno+"blah"+tagno+"\" style=\"display: none\">";

 text += "<td width='20' align='right'> </td>";
 text += "<td width='20'> </td>";
 text += "<td width='20' align='right' class='effectcheck'><input type='checkbox' name='item"+itemno+".tag"+tagno+"' "+checked+" id='"+disp+"'></td>";
 text += "<td width='1000' class='effectitem'> "+disp+"</td>";
 text += "</tr>";

 // return the updated layout
 return text;

Changed one line in that function, and I changed this one line in the addItem function, but you could really do this anywhere. All you need is access to the item number.

// Made the description of the item a link that toggles all the sub-items visibility.
text += "<td width='1000' class='itemdesc'> <a href=\"javascript: toggleDiv('"+itemno+"')\">"+desc+"</a></td>";

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...