How can I get jQuery DataTables to sort on hidden value, but search on displayed value?

后端 未结 9 1605
暖寄归人
暖寄归人 2020-12-08 09:47

I have a simple DataTables grid which contains date columns. I have provided two values for the date in my JSON data set, one for display and one specifically designed so th

9条回答
  •  天命终不由人
    2020-12-08 10:35

    Since you already have your data in sortable and displayable format, this is all code you need.

    It will use Date.Sort for sorting and Date.Display for visuals. This is documented here.

    columns: [{
        data: 'Date',
        render: {
            _:   'Display',
            sort: 'Sort'
        }
    }]
    

提交回复
热议问题