Thanks Shaun,
I tried that and it’s saying that artwork is not defined. I’m not entirely sure how to pass data through extjs but hopefully the more questions that get answered the quicker I learn and the less I ask in future lol.
Anyway here’s the code in cut down version... it’s your gallery snippet again. I know I have to define the artwork variable but I’m unsure how to get the value from the fields.
GAL.view.AlbumItems = function(config) {
config = config || {};
this._initTemplates();
Ext.applyIf(config,{
url: GAL.config.connector_url
,fields: ['id','album','name','description','mediatype','createdon','createdby','filename','filesize','thumbnail','image','image_width','image_height','tags','active','artwork','rank','absoluteImage','relativeImage','menu']
// lots of code deleted here to keep the post small
GAL.window.UpdateItem = function(config) {
var artwork = config.fields+'artwork'; // This doesn't work, it was my attempt at trying to figure out how to get the data. if I set the var artwork = 0 it does what I want but I want that to be taken dependant on the image that is clicked.
config = config || {};
this.ident = config.ident || 'gupdit'+Ext.id();
Ext.applyIf(config,{
title: _('gallery.item_update')
,id: this.ident
,height: 150
,width: 475
,url: GAL.config.connector_url
,action: 'mgr/item/update'
,fileUpload: true
,fields: [{
xtype: 'statictextfield'
,name: 'id'
,fieldLabel: _('id')
,submitValue: true
},{
xtype: 'checkbox'
,fieldLabel: 'artwork'
,name: 'artwork'
,description: ''
,id: 'artwork'
,checked: true
,inputValue: 1
,hidden: artwork != 0 ? false : true
}
]
});
GAL.window.UpdateItem.superclass.constructor.call(this,config);
};
Ext.extend(GAL.window.UpdateItem,MODx.Window);
Ext.reg('gal-window-item-update',GAL.window.UpdateItem);