Mas

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • Mas
    Participant

    Response is this: Copied wrong text. Sorry about the confusion
    {"total":"2","page":"1","records":"7","rows":[{"id":"1","cell":["1","1","one"]},{"id":"3","cell":["3","3","three"]},{"id":"5","cell":["5","5","five"]},{"id":"7","cell":["7","7","seven"],{"id":"8","cell":["8","8","eight"]},{"id":"9","cell":["9","9","nine"]},{"id":"10","cell":["10","10","ten"]}}

    • This reply was modified 7 years, 10 months ago by Mas.
    Mas
    Participant

    Thanks for you suggestions.
    I made changes to my code and now I am using SPServices, CAML Query and JQGrid to fetch and bind data. Now the data is binded to the grid. For 7 records, and rownum=5, it shows Page 1 of 2 and view 1-5 of 7; But when I click on next button to navigate to next page, Page 2 of 2 and view 6-7 of 7 is shown but the data in the grid doesn’t change. It still shows the first 5 items only.

    Response looks like this:
    {"total":"1","page":"1","records":"5","rows":[{"id":"1","cell":["1","1","one"]},{"id":"3","cell":["3","3","three"]},{"id":"5","cell":["5","5","five"]},{"id":"7","cell":["7","7","seven"],{"id":"8","cell":["8","8","eight"]},{"id":"9","cell":["9","9","nine"]},{"id":"10","cell":["10","10","ten"]}}

    • This reply was modified 7 years, 10 months ago by Mas. Reason: Included response
    Mas
    Participant

    Hi, I made the change now data doesn’t get binded to the grid. I removed ‘addrowdata’ and replaced with ‘addjsondata’.

    • This reply was modified 7 years, 11 months ago by Mas.
    Mas
    Participant

    Hi, I made the change now data doesn’t get binded to the grid. I removed ‘addrowdata’ and replaced with ‘addjsondata’.

    function GridSearchText() {
    $(‘#Tracking’).GridUnload();
    var text = $(‘#txttext’).val().trim(); //my text to be searched
    $(“#Tracking”).jqGrid({
    prmNames: {
    search: “isSearch”,
    nd: null,
    rows: “numRows”,
    page: “page”,
    sort: “sortField”,
    order: “sortOrder”
    },
    postData: { PO_txt: text },
    datatype: function (postdata) {
    $(“#load_Tracking”).show();
    $.ajax({
    url: “DataSources.aspx/GridText”,
    data: JSON.stringify(postdata),
    type: “POST”,
    contentType: “application/json”,
    dataType: “JSON”,

    success: function (data, st) {
    if (st == “success”) {
    var grid = $(“#Tracking”)[0];
    grid.addJSONData(eval(“(“+data.responseText+”)”));
    }
    },
    error: function (data, textStatus) {
    $(“#load_PRTracking”).hide();
    alert(‘Error loading Grid’);
    }
    });
    },
    autowidth: true,
    height: “500px”,
    colNames: [“ID”, “Title”, “Desc”],
    colModel: [
    { name: “ID”, align: ‘center’, width: “1500px” },
    { name: “Title”, align: ‘center’, width: “2000px”, sortable: false },
    { name: “Desc”, align: ‘center’, width: “1500px”, sortable: false },
    ],
    jsonReader: { root: “d.rows”, page: “d.page”, total: “d.total”,
    records: “d.records”,cell: “cell”,
    id: “PID”, //index of the column with the PK in it
    userdata: “userdata”,
    repeatitems: true },
    shrinktofit: true,
    rowNum: 3,
    rowList: [3, 6],
    pager: ‘#TrackingPager’,
    sortname: “Title”,
    sortorder: “asc”,
    viewrecords: true,
    gridview: true,
    autoencode: true,
    loadonce: true,
    pgtext: “Page {0} of {1}”,
    loadtext: “Searching  Text …!!!”
    });
    $(“#Tracking”).jqGrid(‘gridResize’, ‘#TrackingPager’);
    }

    • This reply was modified 7 years, 11 months ago by Mas.
Viewing 4 replies - 1 through 4 (of 4 total)

Stay connected with us in your favorite flavor!