开发者

jQuery datatable - Object doesn't support property or method 'numeric-DESC'

I am using the jQuery datatable, and keep getting the error with message "Object doesn't support property or method 'numeric-DESC'"

The following are my codes:

    var oTable = $('#tbSns').dataTable({
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "bStateSave": true,
        "iDisplayLength": 10,
        "aLengthMe开发者_开发百科nu": [[25, 50, 75, -1], [25, 50, 75, "All"]],
        "aaSorting": [[1,'DESC']]
    });

Guess something wrong with aaSorting, however, still tring to find out


A bit of a guess, but I'd say that "DESC" is case sensitive, and should be "desc".

From the plugin's website:

"The aaSorting parameter is an array of arrays where the first value is the column to sort on, and the second is 'asc' or 'desc' as required (it is a double array for multi-column sorting)."

So:

var oTable = $('#tbSns').dataTable({
    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "bStateSave": true,
    "iDisplayLength": 10,
    "aLengthMenu": [[25, 50, 75, -1], [25, 50, 75, "All"]],
    "aaSorting": [[1,'desc']]  // <-- lowercase 'desc'
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜