弹出Confirm
方法1:
<ext:Button ID="Button1" runat="server" Text="sss">
<Listeners>
<Click Handler="Ext.Msg.confirm('提示', '我是前台的,不是后台!');"/>
</Listeners>
</ext:Button>
<ext:Button ID="btnDelete" runat="server" Text="删除" Icon="Delete">
<AjaxEvents>
<Click OnEvent="btnDelete_Click">
<Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowsValues(true))" Mode="Raw">
</ext:Parameter>
</ExtraParams>
<EventMask ShowMask="true" Msg="正在删除数据,请等候 ..."/>
</Click>
</AjaxEvents>
</ext:Button>
方法3:
<script type="text/javascript">
function DelSelectedRows() {
Ext.MessageBox.confirm('提示', '是否要删除这些记录', function(btn) {
if (btn == "yes") {
Coolite.AjaxMethods.DeleteSelectedWorkFlow();//执行后台方法
}
});
}
</script>
//页面部分
<ext:Button ID="Button2" runat="server" Text="Submit">
<Listeners>
<Click Fn="DelSelectedRows" />
</Listeners>
</ext:Button>
方法4:
<script type="text/javascript">
function DelSelectedRows() {
Ext.MessageBox.confirm('提示', '是否要删除这些记录', function(btn) {
if (btn == "yes") {
Coolite.AjaxMethods.DeleteSelectedWorkFlow();//执行后台方法
}
});
}
</script>
//页面部分
<ext:Button ID="Button2" runat="server" Text="Submit">
<Listeners>
<Click Fn="DelSelectedRows" />
</Listeners>
</ext:Button>
方法5:
<ext:Button ID="btnTest" runat="server" Icon="FeedGo" Text="test">
<Listeners>
<Click Handler="if(!#{ComboBox2//某控件的ID}.validate()) {
Ext.Msg.alert('提示','我是在前台判断的!');
return false;
}"/>
</Listeners>
</ext:Button>
弹出prompt
<script language="javascript" type="text/javascript">
function tanchu()
{
// 提示用户输入数据并使用回调方法进得处理: Prompt for user data and process the result using a callback:
Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text) {
if (btn == 'ok') {
// process text value and close...
alert(text);
}
});
}
</script>