{"action":"created","issue":{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/821","labels_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/821/labels{/name}","comments_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/821/comments","events_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/821/events","html_url":"https://github.com/wenzhixin/bootstrap-table/issues/821","id":72017776,"number":821,"title":"Sort by custom data attribute on a <td>?","user":{"login":"use","id":94230,"avatar_url":"https://avatars.githubusercontent.com/u/94230?v=3","gravatar_id":"","url":"https://api.github.com/users/use","html_url":"https://github.com/use","followers_url":"https://api.github.com/users/use/followers","following_url":"https://api.github.com/users/use/following{/other_user}","gists_url":"https://api.github.com/users/use/gists{/gist_id}","starred_url":"https://api.github.com/users/use/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/use/subscriptions","organizations_url":"https://api.github.com/users/use/orgs","repos_url":"https://api.github.com/users/use/repos","events_url":"https://api.github.com/users/use/events{/privacy}","received_events_url":"https://api.github.com/users/use/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/labels/example","name":"example","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-29T23:33:31Z","updated_at":"2015-04-30T05:06:51Z","closed_at":"2015-04-30T05:06:51Z","body":"Hi, I read a couple issues about people trying to do (I think) the same thing I am: #500, #546.\r\n\r\nI am creating an html table, and I want to sort a column by a custom attribute instead of the actual contents of the <td>.  Is there a way to do this?\r\n\r\nI thought this is what [data-sort-name column option](http://bootstrap-table.wenzhixin.net.cn/documentation/) is for, but I can't get it to work.\r\n\r\nFor example:\r\n\r\n    <table data-toggle=\"table\"\r\n        >\r\n        <thead>\r\n            <tr>\r\n                <th data-field=\"fruit\" data-sortable=\"true\">Item</th>\r\n                <th data-field=\"date\"  data-sortable=\"true\" data-sort-name=\"month\">Date</th>\r\n                <th data-field=\"type\"  data-sortable=\"true\">Type</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n            <tr><td>Pear  </td><td data-month=\"1\">January</td> <td>Fruit</td></tr>\r\n            <tr><td>Carrot</td><td data-month=\"3\">March</td>   <td>Vegetable</td></tr>\r\n            <tr><td>Apple </td><td data-month=\"2\">February</td><td>Fruit</td></tr>\r\n        </tbody>\r\n    </table>\r\n\r\nWhen I click the \"Date\" header, I want it to sort by the numerical data-month attribute (1, 2, 3) rather than the <td> text value (January, February, March).\r\n\r\nIs this possible?"},"comment":{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/comments/97664131","html_url":"https://github.com/wenzhixin/bootstrap-table/issues/821#issuecomment-97664131","issue_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/821","id":97664131,"user":{"login":"wenzhixin","id":2117018,"avatar_url":"https://avatars.githubusercontent.com/u/2117018?v=3","gravatar_id":"","url":"https://api.github.com/users/wenzhixin","html_url":"https://github.com/wenzhixin","followers_url":"https://api.github.com/users/wenzhixin/followers","following_url":"https://api.github.com/users/wenzhixin/following{/other_user}","gists_url":"https://api.github.com/users/wenzhixin/gists{/gist_id}","starred_url":"https://api.github.com/users/wenzhixin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenzhixin/subscriptions","organizations_url":"https://api.github.com/users/wenzhixin/orgs","repos_url":"https://api.github.com/users/wenzhixin/repos","events_url":"https://api.github.com/users/wenzhixin/events{/privacy}","received_events_url":"https://api.github.com/users/wenzhixin/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T05:06:51Z","updated_at":"2015-04-30T05:06:51Z","body":"Example: http://jsfiddle.net/e3nk137y/1434/"}}