读书人

Jquery easyui message没弹出

发布时间: 2014-01-12 00:03:16 作者: rapoo

Jquery easyui message没有弹出
大大们好,又来求教了。

整体工程是asp.net的,使用了jquery easyui这个jquery包。
现在碰到一个一问题,在dataGrid中添加的按钮里面的提示信息可以正常弹出来,但是asp.net的服务端控件直接调用javascript的脚本的时候,提示信息却没有弹出。
dataGrid的:


$(function () {
var qParams = { mode:'Qry', id: $("#txtid").val(), name: $("#txtname").val() }; //取得查
var oldRowIndex;
var opt = $('#grid');
opt.datagrid({
width: "auto", //自度
height: 320, //固定高度
nowrap: false, //不截文
striped: true, //列背景切
fitColumns: true, //自
singleSelect: true, //列
queryParams: qParams, //
url: 'CRUDHandler.ashx', //料理
idField: 'id', //主索引
frozenColumns: [[{ field: 'ck', checkbox: true}]], //示核取方
pageList: [10, 15, 20], //每示清
pagination: true, //是否用分
rownumbers: true, //是否示列
toolbar: [{
id: 'btnAdd',
text: '新增',
iconCls: 'icon-add',
handler: function () {
insertRow($(this));
}
}],
onClickRow: function (rowIndex) {
if (oldRowIndex == rowIndex) {
opt.datagrid('clearSelections', oldRowIndex);
}
var selectRow = opt.datagrid('getSelected');
oldRowIndex = opt.datagrid('getRowIndex', selectRow);
}
}).datagrid("getPager").pagination({
buttons: [{
id: 'btnEdit',
iconCls: 'icon-edit',
text: '',
handler: function () {
editRow();
}
}, '-', {


id: 'btnDel',
text: '除',
iconCls: 'icon-remove',
handler: function () {
removeRow();
}
}],
onBeforeRefresh: function () {
return true;
}
});
});

//除料列
function removeRow() {
var row = $("#grid").datagrid('getSelected');
if (row) {
$.messager.confirm('Confirm', '定要除此料?', function (r) {
if (r) {
var index = $("#grid").datagrid('getRowIndex', row);
//$('#grid').datagrid('deleteRow', index); //取得index
$.post('CRUDHandler.ashx', { 'mode': 'DEL', id: row.id }, function (result) {
if (result.success) {
$.messager.alert('Success', '除成功!', 'info', function () {
$('#grid').datagrid('reload'); //刷新面
});
} else {
$.messager.alert('Error', result.msg, 'warning'); //息
}
}, 'json');
}
});

}
else
$.messager.alert('息', '尚未需除的料列!', 'info'); //
}



asp.net控件的:

<asp:Button runat="server" ID="btnOutput" Text="Export" Width="150px" Height="24px" OnClientClick="Export();" />



function Export() {
var row = $('#dgLP71MD').datagrid('getSelected');

if (row == null) {
$.messager.progress({
title: '提示',


msg: '请选择一行!',
timeout: 5000,
showType: 'slide'
});

}
else {
$('#hidClassID').val(row.STAT_CLASS_ID);
__doPostBack('linkBtn', 'Export');
}
}


代码如上。

请问,EasyUI的Message是不是只能用在他自己的控件里面?
如果我想在普通的html控件里面调用,该如何设置?
[解决办法]
你的表单提交了,要组织表单提交

<asp:Button runat="server" ID="btnOutput" Text="Export" Width="150px" Height="24px" OnClientClick="Export();return false" />
[解决办法]
用<input type="button" /> 可提交到服务器了吧 把js忽略掉了
或者<asp:Button runat="server" ID="btnOutput" Text="Export" Width="150px" Height="24px" OnClientClick="Export();return false;" />

读书人网 >JavaScript

热点推荐