Telerik MVC 网格刷新与 jQuery 函数
您好,我有两个 MVC Telerik 网格显示在一个视图中。
每个网格都有一个带有编辑链接的自定义列,
当用户单击编辑链接时,将弹出一个带有表单的对话框模型,并且在用户点击保存按钮后。 下面的脚本将运行
function OpenStopForm() {
$("#dialog:ui-dialog").dialog("destroy");
$("#dialog-model").dialog({
height: 220,
width: 340,
modal: true,
buttons: {
"Save": function () {
var note = $('textarea[name=StopNote]').val();
$.ajax({
type: "POST",
url: "/Medication/StopMedication",
data: { ID: pid, StopNote: note },
dataType: "json",
success: refreshGrid()
});
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
上述函数成功运行后, ,
我希望通过某种 ajax 调用来刷新两个 telerik 网格。
我想调用这样的函数
成功:refreshGrid
function refreshGrid() {
$('#CurrentMedication').data('t-grid').ajaxRequest();
}
但是在执行我的控制器操作之前正在调用refreshGrid函数。
我希望在控制器操作完成后调用此函数。
我不确定我的语法是否正确!
我尝试从此处做一些
事情帮助我如何在ajax Post上成功后调用refreshgrid函数。 另请纠正我刷新网格的功能。
Hi I have a two MVC Telerik Grids Showing up in one View.
Each Grid has a Custom Column with Edit Link
When User Clicks Edit Link a dialog-model will popup with a form and after user hits save button.
Below Script will run
function OpenStopForm() {
$("#dialog:ui-dialog").dialog("destroy");
$("#dialog-model").dialog({
height: 220,
width: 340,
modal: true,
buttons: {
"Save": function () {
var note = $('textarea[name=StopNote]').val();
$.ajax({
type: "POST",
url: "/Medication/StopMedication",
data: { ID: pid, StopNote: note },
dataType: "json",
success: refreshGrid()
});
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
after above function successfully runs,
I want the Two telerik Grids to refresh with some sort of ajax call.
i though of calling a function like this
success: refreshGrid
function refreshGrid() {
$('#CurrentMedication').data('t-grid').ajaxRequest();
}
But refreshGrid function is being called before my Controller action is performed.
I want this function to be called after my controller action is complete.
I am not sure if my syntax is correct!.
I tried to do something from here
Can any one help me how to call the refreshgrid function upon success on ajax Post.
Also please correct me with my function to refresh the grid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经修改了我的 ajax 调用,如下所示
我的刷新网格如下所示
I have modified my ajax call as below
My refresh Grid goes like this
如果有人在寻找这个,则应该调用一个小的更改刷新,例如
If some one looking for this, there is a small change refresh should be called like