jQuery UI Widgets Forums Plugins Data Adapter Alternate Query Parameters Format

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 7 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Alternate Query Parameters Format #89259

    adaugustine
    Participant

    If this is not the appropriate category to post this question, please feel free to move it accordingly.

    Question:
    As we know, there are several other formats for sending query parameters to the server side via Ajax Get. The one JqxWidgets has chosen and the most common is of the form A. Is there an option or suggested callback function to construct a Ajax Get of the form B?

    Form A:
    http://<url>/<endpoint>/?key1=value1&key2=value2

    Form B:
    http://<url>/<endpoint>/value1/value2

    My Specific Scenario:
    Using JqxGrid with server side data binding, the URL specified in the DataAdapter is concatenated with parameters depending on the user’s event. For example, when in advanced mode, paging is enable and the associated query parameters are sent to the server to update the data. For my scenario, I need to transform the Ajax Get url String from form A to Form B.

    Additional Information (in case people search about this on Google):
    In Tapestry, the input parameters for server side event functions are in Form B, where the first parameters is value1 and the second parameter is value2. If you want to follow Tapestry standard component approach using Tapestry’s context convention, you will have to change how JqxWidgets sends the query parameters to server side.

    Thank you for the help and insight.

    Alternate Query Parameters Format #89307

    Dimitar
    Participant

    Hello adaugustine,

    Unfortunately, the way jQWidgets sends parameters cannot be altered. You may, however try to construct the source object’s url dynamically and set it the way you wish, e.g.:

    var param1 = 'someValue';
    var param2 = 'someOtherValue';
    var url = 'data.php';
    
    if (param1 !== undefined) {
      url += '/' + param1;
    
      if (param2 !== undefined) {
        url += '/' + param2;
      }
    }
    
    source.url = url;
    dataadapter.dataBind();
    $('#jqxGrid').jqxGrid('updatebounddata');

    Please also consider using the method POST instead of GET.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.