The rows.sort() method sorts the rows in the JavaScript Scheduler using the specified parameter.
Declaration
DayPilot.Scheduler.rows.sort([spec]);Parameters
spec(string | object) - sort field and order to use
Notes
Call the method without parameters or pass null or undefined to reset row sorting.
Pass a string to specify the sort field. The rows will be sorted in ascending order.
Pass an object to specify both the field name and the sort direction:
field(string) - row data field to use for sortingorder("asc"|"desc") - sort direction
Example
Reset the current row sorting.
dp.rows.sort();Sort rows by a field in ascending order.
dp.rows.sort("capacity");Sort rows using an explicit direction.
dp.rows.sort({
field: "capacity",
order: "desc"
});See Also
DayPilot.Scheduler.rows.sortParam
DayPilot.Scheduler.rows.visible()
Row Sorting [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot