jQWidgets Forums

jQuery UI Widgets Forums Grid Data loading from server.

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Data loading from server. #62860

    Vinay Reddy
    Participant

    I am implementing a grid where data should be loaded depending on the page size and page no. Can i know what should be done.

    Here is my sample Code at Client please let me know what is wrong.

    $(function ()
    {
    $.ajax({
    type: “GET”,
    url:”pagenatedUsers.do”,
    cache: false,
    dataType: ‘json’,
    beforeprocessing: function(data)
    {
    if (data != null)
    {
    source.totalrecords = data[0].TotalRows;
    }
    },
    beforeSend: function ()
    {
    $(“notifcaitonContainer”).html(”);
    },
    error: function (json, textStatus, errorThrown)
    {
    alert(‘ Error :’ + errorThrown);
    },
    success: function (resp)
    {
    alert(“Success”);
    var gridData = resp;
    var gridSource =
    {
    localdata: gridData,
    datatype: ‘json’
    };
    var gridDataAdapter = new $.jqx.dataAdapter(gridSource);

    $(“#notifcaitonContainer”).jqxGrid(
    {
    width: 900,
    height:500,
    source: gridDataAdapter,
    filterable: true,
    sortable: true,
    editable: false,
    pageable: true,
    autoheight: false,
    autoshowfiltericon: true,
    //virtualmode: true,
    selectionmode: ‘singlerow’,
    columns: [
    { text: ‘Name’, datafield: ‘name’, width: 150 },
    { text: ‘Role’, datafield: ‘role’, width: 150 },
    { text: ‘Type’, datafield: ‘type’, width: 80 },
    { text: ‘Email’, datafield: ’email’, width: 80 },
    { text: ‘Description’, datafield: ‘desc’, minwidth: 120 }
    // { text: ‘Cc Email’, datafield: ’emailCC’, minwidth: 120 },
    // { text: ‘Time Zone’, datafield: ‘timezone’, minwidth: 120 }
    ]
    });
    }
    });
    });

    Data loading from server. #62862

    Peter Stoev
    Keymaster

    Hi yennamvinay,

    Simple implementation of Server Paging is available on this page: http://www.jqwidgets.com/jquery-widgets-demo/demos/php/serverpaging.htm?arctic
    I would suggest you to take a look at it and use the same approach.

    Best Regards,
    Peter Stoev

    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.