{"action":"created","issue":{"url":"https://api.github.com/repos/iamisti/mdDataTable/issues/226","repository_url":"https://api.github.com/repos/iamisti/mdDataTable","labels_url":"https://api.github.com/repos/iamisti/mdDataTable/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/iamisti/mdDataTable/issues/226/comments","events_url":"https://api.github.com/repos/iamisti/mdDataTable/issues/226/events","html_url":"https://github.com/iamisti/mdDataTable/issues/226","id":187177896,"number":226,"title":"Sorting of number is not correct","user":{"login":"Tommatheussen","id":13683094,"avatar_url":"https://avatars.githubusercontent.com/u/13683094?v=3","gravatar_id":"","url":"https://api.github.com/users/Tommatheussen","html_url":"https://github.com/Tommatheussen","followers_url":"https://api.github.com/users/Tommatheussen/followers","following_url":"https://api.github.com/users/Tommatheussen/following{/other_user}","gists_url":"https://api.github.com/users/Tommatheussen/gists{/gist_id}","starred_url":"https://api.github.com/users/Tommatheussen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tommatheussen/subscriptions","organizations_url":"https://api.github.com/users/Tommatheussen/orgs","repos_url":"https://api.github.com/users/Tommatheussen/repos","events_url":"https://api.github.com/users/Tommatheussen/events{/privacy}","received_events_url":"https://api.github.com/users/Tommatheussen/received_events","type":"User","site_admin":false},"labels":[{"id":218656873,"url":"https://api.github.com/repos/iamisti/mdDataTable/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"iamisti","id":4672916,"avatar_url":"https://avatars.githubusercontent.com/u/4672916?v=3","gravatar_id":"","url":"https://api.github.com/users/iamisti","html_url":"https://github.com/iamisti","followers_url":"https://api.github.com/users/iamisti/followers","following_url":"https://api.github.com/users/iamisti/following{/other_user}","gists_url":"https://api.github.com/users/iamisti/gists{/gist_id}","starred_url":"https://api.github.com/users/iamisti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamisti/subscriptions","organizations_url":"https://api.github.com/users/iamisti/orgs","repos_url":"https://api.github.com/users/iamisti/repos","events_url":"https://api.github.com/users/iamisti/events{/privacy}","received_events_url":"https://api.github.com/users/iamisti/received_events","type":"User","site_admin":false},"assignees":[{"login":"iamisti","id":4672916,"avatar_url":"https://avatars.githubusercontent.com/u/4672916?v=3","gravatar_id":"","url":"https://api.github.com/users/iamisti","html_url":"https://github.com/iamisti","followers_url":"https://api.github.com/users/iamisti/followers","following_url":"https://api.github.com/users/iamisti/following{/other_user}","gists_url":"https://api.github.com/users/iamisti/gists{/gist_id}","starred_url":"https://api.github.com/users/iamisti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamisti/subscriptions","organizations_url":"https://api.github.com/users/iamisti/orgs","repos_url":"https://api.github.com/users/iamisti/repos","events_url":"https://api.github.com/users/iamisti/events{/privacy}","received_events_url":"https://api.github.com/users/iamisti/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-11-03T20:15:18Z","updated_at":"2016-11-07T17:20:11Z","closed_at":"2016-11-07T14:22:03Z","body":"Using the table like shown in the following example the numbers get sorted as a string, not as a number.\r\n\r\n```\r\n<mdt-table>\r\n  <mdt-header-row>\r\n    <mdt-column column-sort=\"true\">String values</mdt-column>\r\n    <mdt-column column-sort=\"true\">Numeric values</mdt-column>\r\n  </mdt-header-row>\r\n\r\n  <mdt-row ng-repeat=\"valin vm.values\">\r\n    <mdt-cell>{{ val.stringVal }}</mdt-cell>\r\n    <mdt-cell>{{ val.numericVal}}</mdt-cell>\r\n  </mdt-row>\r\n</mdt-table>\r\n```\r\n\r\nWhere vm.values holds the following: \r\n```\r\n[\r\n  {\r\n    \"stringVal\": \"aaaaa\"\r\n    \"numericVal\": 1\r\n  },\r\n  {\r\n    \"stringVal\": \"bbbbb\"\r\n    \"numericVal\": 3\r\n  },\r\n  {\r\n    \"stringVal\": \"ccccc\"\r\n    \"numericVal\": 12\r\n  }\r\n]\r\n```\r\n\r\nIn this example the string values get sorted correctly, but the numeric values get sorted like strings (1, 12, 3).\r\nUsing the other syntax (`mdt-row: { 'data': vm.values, 'column-keys' }`) does seem to sort the numeric correctly.\r\n\r\nEDIT: After some digging around, it seems the value gets transformed to a string in this line: https://github.com/iamisti/mdDataTable/blob/master/app/modules/main/directives/body/mdtCellDirective.js#L60"},"comment":{"url":"https://api.github.com/repos/iamisti/mdDataTable/issues/comments/258900400","html_url":"https://github.com/iamisti/mdDataTable/issues/226#issuecomment-258900400","issue_url":"https://api.github.com/repos/iamisti/mdDataTable/issues/226","id":258900400,"user":{"login":"Tommatheussen","id":13683094,"avatar_url":"https://avatars.githubusercontent.com/u/13683094?v=3","gravatar_id":"","url":"https://api.github.com/users/Tommatheussen","html_url":"https://github.com/Tommatheussen","followers_url":"https://api.github.com/users/Tommatheussen/followers","following_url":"https://api.github.com/users/Tommatheussen/following{/other_user}","gists_url":"https://api.github.com/users/Tommatheussen/gists{/gist_id}","starred_url":"https://api.github.com/users/Tommatheussen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tommatheussen/subscriptions","organizations_url":"https://api.github.com/users/Tommatheussen/orgs","repos_url":"https://api.github.com/users/Tommatheussen/repos","events_url":"https://api.github.com/users/Tommatheussen/events{/privacy}","received_events_url":"https://api.github.com/users/Tommatheussen/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T17:20:11Z","updated_at":"2016-11-07T17:20:11Z","body":"Thanks for the explanation\r\nI did use custom comparators on the mdt-columns now, but if you say mdt-row will be deprecated, I guess it's best to move away from it.\r\n\r\nThe problem I had with using inline mdt-row was the custom html content combining 2 values.\r\nI tried to use a function like described with the row_id variable, but it seems the number always got an undefined value. Perhaps I was doing it wrong :p using the row_id interpolated in the html did show the correct number though, so it seems like the function got executed before the number was actually set or something?"}}
{"actor":{"display_login":"Tommatheussen"}}