jQWidgets Forums

jQuery UI Widgets Forums Grid Data binding to grid using jquery ajax post is not working

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • sampath
    Participant

    Hi,

    Can any one help me.

    In my application , I’m using the Jqxgrid , binding the data to grid using pagemethod concept it was working fine, but now I want to use the jquery ajax concept to get the data from server and update to dropdown control . I’m able to get the data but not able to bind it in grid.

    Here is my sample code

    $.ajax({
    type: “POST”,
    url: “JQueryData.aspx/GetFrequencyData”,
    contentType: “application/json; charset=utf-8”,
    dataType: “json”,
    success: function (result) {
    OnGetFrequencyComplete(result);
    }
    });

    function OnGetFrequencyComplete(result) {

    var FrequencySource =
    {
    datatype: “json”,
    datafields: [
    { name: ‘FrequencyName’ },
    { name: ‘FrequencyId’ }
    ],
    localdata: result,
    id: ‘ddlFrequencyId’
    }

    }

     

    Regards,

    J Sampath Kumar.


    Peter Stoev
    Keymaster

    Hi,

    In your code, the OnGetFrequencyComplete function is defined after the Ajax call. According to me OnGetFrequencyComplete is possible to be undefined at the point where you call it. I suggest you to debug that code and check that.

    Best Regards,
    Peter Stoev

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


    sampath
    Participant

    Hello Peter,

    I have debugged it , I’m getting the same output result from server and binding same data to control but still not able to see the data in dropdown control.

    Regards,
    J Sampath Kumar,
    Osmosys.


    Peter Stoev
    Keymaster

    Hi,

    You can get the same output from the server, but if your Grid initialization function – OnGetFrequencyComplete is undefined when you try to call it, that does not much matter, because the Grid will not be initialized.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.