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