I want to cancel a ajax request from a javascript function. I tried the following, did not work
i want to cancel the request and hide the loading panel from ResetRequest() function.
Please help
Regards
Arijit Chatterjee
var requestInProgress; |
function OnRequestStart(sender, args) { |
requestInProgress = args.XMLHttpRequest; |
} |
function ResetRequest() { |
requestInProgress.abort(); |
} |
i want to cancel the request and hide the loading panel from ResetRequest() function.
Please help
Regards
Arijit Chatterjee
6 Answers, 1 is accepted
0
Hello Arijit,
I recommend you try this approach:
Export from ajaxified grid
Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I recommend you try this approach:
<
script
type
=
"text/javascript"
>
function onRequestStart(sender, args)
{
if (something)
args.set_enableAjax(false);
}
</
script
>
Export from ajaxified grid
Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
arijit
Top achievements
Rank 1
answered on 03 Mar 2010, 04:04 PM
No, I don't want to decide the cancel before submit. I want to cancel it after the submit.
So this is not helpful in my case. please suggest.
Regards
So this is not helpful in my case. please suggest.
Regards
0
robertw102
Top achievements
Rank 1
answered on 03 Mar 2010, 09:15 PM
You should call args.set_cancel(true) to prevent the request from continuing.
I hope that helps.
0
arijit
Top achievements
Rank 1
answered on 04 Mar 2010, 02:17 AM
I have already written that I will cancel the request from another javascript function, see my first post.
Then how i will get that args ?
It is not helpful.
Then how i will get that args ?
It is not helpful.
0
robertw102
Top achievements
Rank 1
answered on 04 Mar 2010, 02:51 PM
Where would you be calling the ResetRequest method from? Isn't it OnRequestStart? If so why not pass the args from that method to your ResetRequest method.
0
Hello Arijit,
The OnRequestStart event is the latest point where you can cancel the request on the client.
Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
The OnRequestStart event is the latest point where you can cancel the request on the client.
Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.