-- 
*********************************************************************************
Daniel Wells, Library Programmer Analyst [email protected]
Hekman Library at Calvin College
616.526.7133
>>> On 5/27/2011 at 2:06 PM, Dan Scott <[email protected]> wrote:
> 
> so that the final product looks like:
> 
> function _holdingsDrawMFHDEntry(entryNum, entryName, entry) {
>       var flatEntry = entry.toString().replace(/,/g, '<br />');
>       dojo.place("<tr><td> </td><td nowrap='nowrap' class='rdetail_desc'>"
> + entryName + "</td><td class='rdetail_item'>" + flatEntry +
> "</td></tr>", "rdetail_holdings_tbody_" + entryNum, "last");
> }

The above change will replace *all* the commas in your holdings with breaks, 
which at least for our data didn't work out.  I humbly suggest the following 
alternative:


function _holdingsDrawMFHDEntry(entryNum, entryName, entry) {
        var flatEntry = entry.join('<br/>');
        dojo.place("<tr><td> </td><td nowrap='nowrap' class='rdetail_desc'>"
+ entryName + "</td><td class='rdetail_item'>" + flatEntry +
"</td></tr>", "rdetail_holdings_tbody_" + entryNum, "last");
}



or (to continue adding spaces after the real commas):



function _holdingsDrawMFHDEntry(entryNum, entryName, entry) {
        var flatEntry = entry.join('<br/>').replace(/,/g, ', ');
        dojo.place("<tr><td> </td><td nowrap='nowrap' class='rdetail_desc'>"
+ entryName + "</td><td class='rdetail_item'>" + flatEntry +
"</td></tr>", "rdetail_holdings_tbody_" + entryNum, "last");
}


In both versions just the "var flatEntry..." line is being changed.

Thanks,
Dan


Reply via email to