Changeset 7779
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/list/ParentItemColumn.java
r7773 r7779 78 78 col.setFilterProperty("/"+tmp[1]+"/"+tmp[2]+"/name"); 79 79 } 80 col.setValueType(Type.STRING);81 80 col.setClazz("parentitemcol"); 82 81 if (property == null || property.getHibernateType().isEntityType()) 83 82 { 84 83 col.setExportFormatter(new NameableFormatter()); 84 col.setFilterProperty(col.getProperty()+".name"); 85 col.setValueType(Type.STRING); 85 86 if (!helper.lazy) col.setFormatter(new CollectionFormatter(new LinkedItemFormatter())); 86 87 } 87 88 else 88 89 { 89 col.setExportFormatter(new ToStringFormatter<>()); 90 Type colType = Type.fromHibernateType(property.getHibernateType()); 91 if (colType != null) 92 { 93 col.setValueType(colType); 94 col.setExportFormatter(FormatterFactory.getTypeFormatter(dc.getSessionControl(), colType)); 95 } 96 else 97 { 98 // Last fallback -- if we get here the Type.fromHibernateType() should be update with special cases 99 col.setValueType(Type.STRING); 100 col.setExportFormatter(new ToStringFormatter<>()); 101 } 90 102 if (!helper.lazy) col.setFormatter(new CollectionFormatter(col.getExportFormatter())); 91 103 } -
trunk/www/common/columns/add_parent_column.js
r7777 r7779 31 31 var currentAnnotationTypesAll; 32 32 var currentAnnotationTypesCategory; 33 34 var nameCol = {'id': '.', 'text': 'Name'}; 35 var externalIdCol = {'id': 'externalId', 'text': 'External ID'}; 36 var bioPlateCol = {'id': 'bioWell.bioPlate', 'text': 'Bioplate'}; 37 var entryDateCol = {'id': 'entryDate', 'text': 'Registered'}; 38 var remainingQCol = {'id': 'remainingQuantity', 'text': 'Remaining quantity'}; 39 40 var creationRegistredCol = {'id': 'creationEvent.entryDate', 'text': 'Registered'}; 41 var creationProtocolCol = {'id': 'creationEvent.protocol', 'text': 'Protocol'}; 42 var creationHardwareCol = {'id': 'creationEvent.hardware', 'text': 'Hardware'}; 43 44 var protocolCol = {'id': 'protocol', 'text': 'Protocol'}; 45 var hardwareCol = {'id': 'hardware', 'text': 'Hardware'}; 46 var softwareCol = {'id': 'software', 'text': 'Software'}; 47 48 var staticColumns = { 49 'BIOSOURCE': [nameCol, externalIdCol, entryDateCol], 50 'SAMPLE': [nameCol, externalIdCol, bioPlateCol, creationRegistredCol, creationProtocolCol, remainingQCol], 51 'EXTRACT': [nameCol, externalIdCol, bioPlateCol, creationRegistredCol, creationProtocolCol, remainingQCol], 52 'PHYSICALBIOASSAY': [nameCol, creationRegistredCol, creationProtocolCol, creationHardwareCol], 53 'DERIVEDBIOASSAY': [nameCol, entryDateCol, protocolCol, softwareCol, hardwareCol] 54 } 33 55 34 56 /** … … 82 104 configure.typeInfoLoaded = function(request) 83 105 { 84 App.debug(request.responseText);85 106 var response = JSON.parse(request.responseText); 86 107 if (response.status != 'ok') … … 122 143 var annotationTypes = frm.showAllAnnotationTypes.checked ? currentAnnotationTypesAll : currentAnnotationTypesCategory; 123 144 frm.column.length = 0; 124 frm.column[frm.column.length] = new Option('Name', '.'); 145 146 // Add static property columns depending on itemtype 147 var cols = staticColumns[parentType] || []; 148 for (var i = 0; i < cols.length; i++) 149 { 150 var c = cols[i]; 151 frm.column[frm.column.length] = new Option(c.text, c.id); 152 } 153 154 // Add annotation columns 125 155 for (var i = 0; i < annotationTypes.length; i++) 126 156 {
Note: See TracChangeset
for help on using the changeset viewer.