jQWidgets Forums

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Server side sorting Server side sorting #29000

    vancourse
    Member

    It worked.. the “gotopage” also retained the “sort” information.. hence I removed the redundant server call upon hitting “sort”. My sort function now looks like this:

    public sort(column: string, direction: string)
    {
    $(#jqxgrid).jqxGrid(‘gotopage’, 0);
    }

    in reply to: Server side sorting Server side sorting #28992

    vancourse
    Member

    Peter,

    Thank you. That is an option. However, since I am also doing server-side paging, hence, a call to “gotopage” will trigger a server call… which I want to avoid… is there any other way? Appreciate your help..

    Here are the options that I am using:

    this.gridOptions = {
    width: "100%",
    source: this.dataAdapter,
    filterable: false,
    sortable: true,
    columnsresize: true,
    altrows: true,
    autoheight: true,
    pageable: true,
    virtualmode: true,//required, for server side paging
    rendergridrows: function (obj) {
    return obj.data;
    },
    columns: this.getColumns(),
    selectionmode: 'multiplerowsextended',
    };
    this.gridDataSourceOptions =
    {
    datatype: "json",
    cache:false,
    datafields: this.getSchema(),
    url: this.getWsUri(),
    sort: (column, direction) => {
    this.sort(column, direction);
    },
    formatdata: (data) => { this.enhanceDataBeforeRequest(data);},
    root: 'Rows',
    beforeprocessing: (data) => {
    this.gridDataSourceOptions.totalrecords = data.Grid.TotalItems;
    }
    };
    this.dataAdapter = new $.jqx.dataAdapter(this.gridDataSourceOptions, {
    loadServerData: this.getData,
    loadError: function (xhr, status, error) {
    alert(error);
    }
    });
Viewing 2 posts - 1 through 2 (of 2 total)