// 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 : '✓'
});
);
},
- _buildRowSelectInput : function(rowIdx, item) {
- if(!item) return '';
+ _formatRowSelectInput : function(rowIdx) {
+ if(rowIdx === null || rowIdx === undefined) return '';
+ console.log("<input type='checkbox' name='autogrid.selector' row='" + rowIdx + "'/>");
return "<input type='checkbox' name='autogrid.selector' row='" + rowIdx + "'/>";
},
if(!item) return '';
var name = this.grid.store.getValue(item, 'name');
var id = this.grid.store.getValue(item, 'id');
- return '<a href="[% ctx.base_path %]/acq/funding_source/view/'+id+'">'+name+'</a>';
+ // 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 '<a href="[% ctx.base_path %]/acq/funding_source/view/'+vals[0]+'">'+vals[1]+'</a>';
+ }
}
</script>
editOnEnter='true'>
<thead>
<tr>
- <th field="name" get='getName'/>
+ <th field="name" get='getName' formatter='formatName'/>
<th field="owner" get='getOrgInfo'/>
<th field="balance" get='getBalanceInfo'/>
</tr>