Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using alert i am able to set "transText" value on data['translate'] line no. 17 but without alert unable to set "transText" value on data['translate'] line no. 17 #1041

Open
nagendra87k opened this issue Aug 26, 2017 · 0 comments

Comments

@nagendra87k
Copy link

    • $('#cell').editable({
    •                             type: 'text',
      
    •                             url: base_url+'languages/automaticSetReviewStatus',
      
    •                             params: function(params) {
      
    •                                 var data = {};
      
    •                                 var transText = "";
      
    •                                 var sourceText = params.value ;
      
    •                                 var sourceLang = "auto";
      
    •                                 var targetLang = "en";
      
    •                                 var url = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=" + sourceLang + "&tl=" + targetLang + "&dt=t&q=" + encodeURI(sourceText);
      
    •                                 $.getJSON(url, function (json) {
      
    •                                     transText = json[0][0][0];
      
    •                                 });
      

alert(transText)
16. -
17. - data['translate'] = transText;
18. - data['pk'] = params.pk;
19. - data['name'] = params.name;
20. - data['value'] = params.value;
21. - abc=params;
22. - data['english'] = 'EN;?>';
23. - return data;
24. -
25. - },
26. - success: function(response) {
27. - var obj = JSON.parse(response);
28. - if (obj.status == 1){
29. - $("#text-").html(obj.message);
30. - $("#checkbox-").prop('checked', true);
31. - }else {
32. - $("#text-").html(obj.message);
33. - $("#checkbox-").prop('checked', false);
34. - }
35. - }
36. - });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant