我正在使用footable来展示一张巨大的桌子。我在json中显示列:
"columns": $.get("/masteradmin/full-report-columns/", postdata_columns, 'json'),
我想默认对月份列进行排序。如何在json中设置data-sort-initial="descending"
变量?
{
"name": "month",
"title": str(_("Month")),
"type": "date",
"formatString": "MMMM YYYY"
},
由于
答案 0 :(得分:1)
示例说明了如何实现这一目标:http://fooplugins.github.io/FooTable/docs/components/sorting.html#options
{
"name": "month",
"title": str(_("Month")),
"type": "date",
"formatString": "MMMM YYYY",
"sorted": true,
"direction": "DESC"
},