当用户单击按钮delete时,我希望出现一个对话框,以确认删除。我可以让对话框出现在页面加载时,但遇到问题让它出现在按钮点击上:
<?php echo $this->dialogContainer(
'dialog',
'Are you sure you want to delete this postcode?',
array(
'autoOpen' => false,
'draggable' => true,
'modal' => true,
'resizable' => true,
'title' => 'Confirm Delete',
'closeOnEscape' => true,
'buttons' => array(
'Delete' => new Zend_Json_Expr('function() {
document.location=\''.$this->url(array(
'module' => 'crm',
'controller' => 'postcode',
'action' => 'delete'
),"", true) .'\'
}'),
'Cancel' => new Zend_Json_Expr('function() {
$(this).dialog(\'close\');
}')
),
),
); ?>
dialogContainer 中是否有允许这样做的东西,或者我是否需要创建一个单独的函数,我单独加载?
谢谢。