jQWidgets Forums

jQuery UI Widgets Forums Grid Alternate to $ajax post method

This topic contains 5 replies, has 2 voices, and was last updated by  chengamkathiravan 11 years, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Alternate to $ajax post method #50398

    chengamkathiravan
    Participant

    Hi,

    We need alternate jqwidgets code to below ajax code because this(Ajax post) code is not working properly in cross browser.

    Also we are accessing java json service and to bind the data with grid.

    ajax post method:-

      $.ajax({
      headers: { “Content-Type”: “application/json”, “AuthenticationToken”: “3C9DA1B8-FA69-4195-B1A1-B6CF43CD3ACF” },
      data: “<Employee><GroupId>value</GroupId></Employee>”,
      type: “POST”,
      async: false,
      cache: false,
      url: ‘https://ip/Tpx/Employee/testurl/json/v1’,

      success: function (data) {
      alert(‘Success’);
      },
      error: function (json, textStatus, errorThrown) {
      alert(“jqXHR= ” + json.statusText + “, textStatus= ” + textStatus + “, errorThrown= ” + errorThrown)
      }

      Points to your notice:-
      1) We need to post data (data:xxx) to url.
      2) We need to pass authentication token, content type in header.
      3) This method is POST.

      Please give alternate code using “dataAdapter” or any other common method to be worked in cross browser.

      Best Regards
      Bala

    Alternate to $ajax post method #50401

    chengamkathiravan
    Participant

    Hi,
    One more point is already our java service is CORS enabled. Also this given code works fine in firefox browser. But in IE and Chrome it is not working.

    We need stable code to be worked across cross browser.

    Best Regards
    Bala.

    Alternate to $ajax post method #50403

    Peter Stoev
    Keymaster
    Alternate to $ajax post method #50433

    chengamkathiravan
    Participant

    Hi Peter,

    Thanks for your reply.

    I gone through the given url.
    Meanwhile We are explaining below our requirement step by step.

    Please go through the steps deeply.

    1) We need to access JAVA json service.
    2) We need to POST data to that json service.
    3) We need to send authentication token to that json service as Header.
    4) Our output from service is json.

    For this we try to use jquery ajax post method. But it is not working in cross browsers.

    Please answer to our below questions.

    1) Is it possible to POST data to java service using “jqxDataAdapter” like jquery ajax method?
    2) Is it possible to send authentication token to java service as HEADER using “jqxDataAdapter” like jquery ajax method?

    If your answer is yes, then please provide code/link/sample to achieve the same.

    Please answer to our questions at earliest.

    Best Regards
    Bala.

    Alternate to $ajax post method #50439

    Peter Stoev
    Keymaster

    Hi Bala,

    1. POST is not a problem. As you probably saw in the help topics, you should set the source object’s type to POST i.e the same as you do with jQuery Ajax.
    2. headers member is not available option.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Alternate to $ajax post method #50469

    chengamkathiravan
    Participant

    Hi Peter,

    Due to problem with $ajax post method, we tried aspx webmethods and bind the jqxgrid.

    We will proceed with webmethod for now.

    We need any help in this regard, then we will intimate to you.

    Best Regards
    Bala.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.