如何将方法放入单个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" });
我想将“排序”放入上层函数,因为我不想触发这两次。