I see there are lot of related question in this site. But Still I am not able to make this work for my requirement.
This is my ajax call
$.ajax({
type: "POST",
url: "/Medication/StopMedication",
data: { ID: pid, StopNote: note },
dataType: "json",
success: function () {
refreshGrid()
}
});
and my refresh grid is like this
function refreshGrid() {
alert("I am at Refresh Grid");
if ($(".t-grid .t-refresh").exists()) {
$(".t-grid .t-refresh").trigger('click');
}
}
First of all after success my ajax call is not firing refreshGrid() function. can any one help me with this
I found the issue and fixed it:
I Made these Changes
dataType: "text",
success: function (data) {
refreshGrid();
}
function refreshGrid() {
$(".t-grid .t-refresh").trigger('click');
}