Remote sorting Problem

42 views
Skip to first unread message

Greg Czechowicz

unread,
Oct 18, 2013, 6:41:50 PM10/18/13
to param...@googlegroups.com
The grid and data show up fine, but the sortby doesnt come back after you click once. posting the code below. I added an alert there that shows the sortby and it is undefined after the first try..

 var dataModel = {
            location: "remote",
            sorting: "remote",
            paging: "remote",
            dataType: "JSON",
            method: "GET",
            curPage: 1,
            rPP: 20,
            sortIndx: 0,
            sortDir: "up",
            rPPOptions: [1, 10, 20, 30, 40, 50, 100, 500, 1000],
            getUrl: function () {
               
                var sortDir = (this.sortDir == "up") ? "asc" : "desc";
               
                var sort = ['OrderID', 'CustomerName', 'UnitPrice', 'OrderDate'];
                alert(sort[this.sortIndx]);
                return {
                    url: "Paging", data: "pq_curPage=" + this.curPage + "&pq_rPP=" +
                        this.rPP + "&sortBy=" + sort[this.sortIndx] + "&dir=" + sortDir
                };
            },
            getData: function (dataJSON) {
                //var data=              
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: dataJSON.data };
            }
        }

paramquery

unread,
Oct 19, 2013, 12:44:19 AM10/19/13
to param...@googlegroups.com
Greg

Could you please post your question in the same topic you started in the forum.


Thank you
Reply all
Reply to author
Forward
0 new messages