jQWidgets Forums

jQuery UI Widgets Forums Plugins Data Adapter Add support for "global" ajax settings

This topic contains 5 replies, has 3 voices, and was last updated by  luesak 10 years, 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Add support for "global" ajax settings #61710

    luesak
    Participant

    Hi,

    There is currently no way to specify the global parameter of the ajax request that is sent with the data adapter.
    This is useful in the scenario where you need to isolate the ajax request from other ones.

    Thanks

    Kim

    Add support for "global" ajax settings #61753

    Peter Stoev
    Keymaster

    Hello Kim,

    With the loadServerData, you can override the default Ajax call and use your custom one.

    Best Regards,
    Peter Stoev

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

    Add support for "global" ajax settings #61835

    sira
    Participant

    I can override Ajax with loadServerData, but grid not working.
    It cannot filter or sort and records fix at 20 row only,if more than records of empty.
    Can you tell me loadServerData Sample ?

    Below this my code:

    var dataAdapter = new $.jqx.dataAdapter(dataSource, {loadServerData: function (postdata, source, callback)
    	{
    		$.ajax({
    			url: source.url,
    			data: postdata,
    			type: "POST",
    			async: true,
    			global: false,
    			success: function (data, status, xhr)
    			{
    				if ($.isFunction(source.beforeprocessing))
    				{
    					source.beforeprocessing(data, status, xhr);
    				}
    				var records = $.parseJSON(data);
    				dataAdapter.loadjson(null, records, source);
    				callback({records: dataAdapter.records, totalrecords: records[0].TotalRows});
    			}
    		});
    	}});
    Add support for "global" ajax settings #62013

    luesak
    Participant

    Peter,

    Can we have the default implementation for loadServer data that will support filtering, sorting, etc?

    There’s no documentation anywhere so we don’t even know where to start.

    Thanks!

    Kim

    Add support for "global" ajax settings #62020

    Peter Stoev
    Keymaster

    Hi Kim,

    There is no such implementation anywhere. The dataAdapter just sends server requests and if there are any sorting, filtering params, they are stored in the postData varialble. On your server, you will have to implement logic depending on these params to return appropriate data.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Add support for "global" ajax settings #62035

    luesak
    Participant

    Peter,

    Thanks for the tip. All I had to do was change $_GET to $_REQUEST on the server side.

    Thanks

    Kim

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

You must be logged in to reply to this topic.