From: erickson Date: Mon, 11 May 2009 13:59:24 +0000 (+0000) Subject: dojo-1.3 treats HTML from a grid getter as raw text, but it will let you return HTML... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0fcec0d90655909a30c638727dad6b637f7406c4;p=Evergreen.git dojo-1.3 treats HTML from a grid getter as raw text, but it will let you return HTML from a formatter. fixed the autogrid selector cell. tweaked fuding_source list as well. i'm sure there are more UI's to track down git-svn-id: svn://svn.open-ils.org/ILS/trunk@13123 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 7db33cd009..b7f19cb41b 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -74,7 +74,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { // insert the selector column pushEntry({ field : '+selector', - get : function(rowIdx, item) { return self._buildRowSelectInput(rowIdx, item); }, + formatter : function(rowIdx) { return self._formatRowSelectInput(rowIdx); }, + get : function(rowIdx, item) { if(item) return rowIdx; }, width : this.selectorWidth, name : '✓' }); @@ -194,8 +195,9 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { ); }, - _buildRowSelectInput : function(rowIdx, item) { - if(!item) return ''; + _formatRowSelectInput : function(rowIdx) { + if(rowIdx === null || rowIdx === undefined) return ''; + console.log(""); return ""; }, diff --git a/Open-ILS/web/templates/default/acq/financial/list_funding_sources.tt2 b/Open-ILS/web/templates/default/acq/financial/list_funding_sources.tt2 index 172ef193c3..f7dbd3ecc1 100644 --- a/Open-ILS/web/templates/default/acq/financial/list_funding_sources.tt2 +++ b/Open-ILS/web/templates/default/acq/financial/list_funding_sources.tt2 @@ -9,7 +9,15 @@ if(!item) return ''; var name = this.grid.store.getValue(item, 'name'); var id = this.grid.store.getValue(item, 'id'); - return ''+name+''; + // weird hack to pass the data we need to the formatter which is now required for HTML cell values + return id + ':' + name; + } + + function formatName(value) { + if(value) { + var vals = value.split(/:/); + return ''+vals[1]+''; + } } @@ -32,7 +40,7 @@ editOnEnter='true'> - +