剑道ui网格不记得发送数据

时间:2014-02-08 13:45:16

标签: javascript kendo-grid

我使用远程数据制作网格

$("#orderGrid").kendoGrid({
    scrollable: false, 
    columns: [ 
           { field: "order_id", title: "ID", width:"30px",template:"<a href='<%=request.getContextPath()%>/order/edit/#=order_id#'>#=order_id#</a>" },
           { field: "order_date", title: "Дата",width:"65px"},
           { field: "order_customer", title: "Заказчик"},
           { field: "order_transport", title: "Перевозчик"}
         ],
dataSource: {
    transport: {
        read:  {
            url: "<c:url value="/order/json"/>",
            dataType: "json",
            data: someData
        },
    },
    type: "odata",
    schema: {
        data: function (data) {
            return data["data"];
        },
        total: function (data) {
            return data["count"];
        }
    },
    pageSize: 20,
    serverPaging: true,
    serverFiltering: true,
    serverSorting: true
},
pageable: true,
sortable: true,
filterable: true,
});

之后我想制作过滤器并更新数据

var grid = $("#orderGrid").data("kendoGrid");
grid.dataSource.read(filterData);

但之后!当我分页网格时,它将旧数据(someData)发送到服务器并发生错误....我需要filterData ....

grid.refresh();

不要帮助......

1 个答案:

答案 0 :(得分:0)

答案

transport: {
    read:  {
        url: "<c:url value="/order/json"/>",
        dataType: "json",
        data: function(){
            return filterData;
        }
    },
},