如何将方法放入单个函数中

时间:2016-07-18 03:34:47

标签: jquery jsgrid

如何将方法放入单个Jquery函数?

$("#jsGrid").jsGrid({
    width: "100%",
    height: $(window).height() * 0.9,
    filtering: true,
    sorting: true,
    autoload: true,
    controller: db,
    fields: [
        { name: "ID", type: "number", width: "100px"},
        { name: "name", type: "text", width: "150px"},
        { name: "Status", type: "text", width: "100px"}
    ],
});
$("#jsGrid").jsGrid("sort", { field: "ID", order: "desc" });

我想将“排序”放入上层函数,因为我不想触发这两次。

0 个答案:

没有答案