[OPEN-ILS-GENERAL] subscription summary screen

Dan Wells dbw2 at calvin.edu
Fri Jun 3 16:08:43 EDT 2011



-- 
*********************************************************************************
Daniel Wells, Library Programmer Analyst dbw2 at calvin.edu
Hekman Library at Calvin College
616.526.7133
>>> On 5/27/2011 at 2:06 PM, Dan Scott <dan at coffeecode.net> 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




More information about the Open-ils-general mailing list