I'm kind of new to mochikit and I'm having an issue with building a
table.  The table works fine but what I would like to do is make a TD
element optional.  I have a checkbox but only want it to appear if when
I'm looping over data that when details.exports[i].contact is not null
display, otherwise replace with an empty TD.  I know i have to prebuild
the variable to do this and place it in the appendchild but not sure of
the format.

I appreciate any suggestions!
Here's a example of what the current code looks like.
Thanks,

var def = loadJSONDoc("qry_exportables.cfm");
function exportCallback(details) {
var exportTable = TABLE(null,
                           THEAD(null,
                TR( null, TH( null,'Checkrun'),
                        TH( null, 'Vendor #'),
                        TH( null, 'Name'),
                TH( null, 'Payment'),
                TH( null, 'Contact')
                  )));
        var tbod = TBODY({id : "exportRowsBody"});
              for (var i = 0; i < details.exports.length; i++) {
                 tbod.appendChild(TR( null,
                TD( null , details.exports[i].checkrun),
                TD( {"width" : "75", "align" : "center"} ,
details.exports[i].vendor_number),
                TD( null , details.exports[i].vendor_name),
                TD( {"align" : "right"} , details.exports[i].payment_amount),
                TD( null , details.exports[i].contact),
                                TD( null ,
A({"style.cursor":"hand","onclick":"return launchEmail(" +
details.exports[i].vendor_id + ");"}, details.exports[i].contact)),
                TD( null, INPUT( { type : "checkbox", checked : "yes",
                                     id : "vendorNotify",   name : 
"vendorNotify"} ))
                ));                                             }
        exportTable.appendChild(tbod);
        replaceChildNodes("exportables",exportTable);


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to