on 2016 Jun 13 3:24 PM
Hi experts ,
I developed here one oData Get call that is working fine. But form the success function i just need to call one more function there .
So how to call the other function from the success function.
Plz correct me if i may did wrong anywhere. And send me your guidelines.
I attached my coding here .
press :function () {
var surl = "service url here ";
OData.request
({
requestUri:surl,
method: "GET",
headers:
{
"X-Requested-With": "XMLHttpRequest",
"Content-Type": "application/atom+xml",
"DataServiceVersion": "2.0",
"X-CSRF-Token":"Fetch"
}
},
function(data, response) { // onSuccess function called when everything is ok
this.applySearch(); // if i call the function like this i am getting error like this is not a function like that
}
},
applySearh : function () {
}
Thanks and Regards ,
Damian .A
Damian,
that is because this is out of scope... you can have
var self = this;
right before your ajax call..
then inside the success function:
self.applySearch(); // instead of this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please mark this Discussion with a Correct Answer (closes, but does not lock the Discussion) and Helpful Answer where appropriate. See http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be.
Do not use Assumed Answered as it confuses anyone looking for the specific answer. If you dig into the Getting Started link (top right of each SCN page), you are only instructed to mark Helpful or Correct Answers to Discussion responses.
Thanks, Mike (Moderator)
SAP Technology RIG
User | Count |
---|---|
75 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.