我正在使用_prepareLayout()
magento\app\design\adminhtml\default\default\template\downloadable\product\edit\downloadable\links.phtml:
protected function _prepareLayout()
{
$this->setChild(
'upload_button',
$this->getLayout()->createBlock('adminhtml/widget_button')->addData(array(
'id' => '',
'label' => Mage::helper('adminhtml')->__('Upload Files'),
'type' => 'button',
'onclick' => 'Downloadable.massUploadByType(\'links\');Downloadable.massUploadByType(\'linkssample\')'
))
);
}
你能提一下它的来源:'Downloadable.massUploadByType(\'links\');Downloadable.massUploadByType(\'linkssample\')'
答案 0 :(得分:0)
看看app / design / adminhtml / default / default / template / downloadable / product / edit / downloadable.phtml:
massUploadByType : function(type){
try {
this.uploaderObj.get(type).each(function(item){
container = item.value.container.up('tr');
if (container.visible() && !container.hasClassName('no-display')) {
item.value.upload();
} else {
Downloadable.unsetUploaderObj(type, item.key);
}
});
} catch (e) {
try {
console.log(e);
} catch (e2) {
alert(e.name + '\n' + e.message);
}
}
}