the "comment" is the first line of the "notes" field from a manifest, show it in the grid and allow editing the full notes. Hack the click event listener a bit together for the right aligned edit action button, but it works out well and is efficient (only one event listener is much cheaper than per-buttons ones). Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
		
			
				
	
	
		
			39 lines
		
	
	
		
			649 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			649 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| Ext.define('PBS.window.NotesEdit', {
 | |
|     extend: 'Proxmox.window.Edit',
 | |
|     mixins: ['Proxmox.Mixin.CBind'],
 | |
| 
 | |
|     title: gettext('Notes'),
 | |
| 
 | |
|     width: 600,
 | |
|     height: '400px',
 | |
|     resizable: true,
 | |
|     layout: 'fit',
 | |
| 
 | |
|     autoLoad: true,
 | |
| 
 | |
|     defaultButton: undefined,
 | |
| 
 | |
|     notesFieldName: 'notes',
 | |
| 
 | |
|     setValues: function(values) {
 | |
| 	let me = this;
 | |
| 	if (typeof values === "string") {
 | |
| 	    let v = values;
 | |
| 	    values = {};
 | |
| 	    values[me.notesFieldName] = v;
 | |
| 	}
 | |
| 	me.callParent([values]);
 | |
|     },
 | |
| 
 | |
|     items: {
 | |
| 	xtype: 'textarea',
 | |
| 	name: 'notes',
 | |
| 	cbind: {
 | |
| 	    name: '{notesFieldName}',
 | |
| 	},
 | |
| 	height: '100%',
 | |
| 	value: '',
 | |
| 	hideLabel: true,
 | |
|     },
 | |
| });
 |