{"action":"created","comment":{"url":"https://api.github.com/repos/Invoca/backdraft/pulls/comments/32637998","id":32637998,"diff_hunk":"@@ -261,24 +291,177 @@ var LocalDataTable = (function() {\n       this.trigger(\"change:selected\", data);\n     },\n \n+    // DataTables does not provide a good way to programmatically disable sorting, so we:\n+    // 1) remove the default sorting event handler that dataTables adds\n+    // 2) Create a div and put the header in it.  We need to do this so sorting doesn't conflict with filtering\n+    // on the click events.\n+    // 3) insert our own event handler on the div that stops the event if we are locked\n+    // 4) re-insert the dataTables sort event handler\n     _installSortInterceptors: function() {\n-      // dataTables does not provide a good way to programmatically disable sorting, so we:\n-      // 1) remove the default sorting event handler that dataTables adds\n-      // 2) insert our own that stops the event if we are locked\n-      // 3) re-insert the dataTables sort event handler\n       var self = this;\n       this.dataTable.find(\"thead th\").each(function(index) {\n-        $(this).off(\"click.DT\").on(\"click\", function(event) {\n+        $(this).off(\"click.DT\");\n+        // put the header text in a div\n+        var nDiv = document.createElement('div');\n+        nDiv.className = \"DataTables_sort_wrapper\";\n+        $(this).contents().appendTo(nDiv);\n+        this.appendChild(nDiv);\n+        // handle clicking on div as sorting\n+        $('.DataTables_sort_wrapper', this).on(\"click\", function(event) {\n           if (self.lock(\"sort\")) {\n             event.stopImmediatePropagation();\n           }\n         });\n         // default sort handler for column with index\n-        self.dataTable.fnSortListener($(this), index);\n+        self.dataTable.fnSortListener($('.DataTables_sort_wrapper', this), index);\n+      });\n+    },\n+\n+\n+    // Here we make different controls based on the filter type we're dealing with.\n+    // * string filtering requires a single text input\n+    // * numeric filtering requires three text inputs for greater than, less than, and\n+    //   equal to.  these text inputs need to be uniquely identified so we can filter on\n+    //   values entered into more than one of them\n+    // * list filtering requires a list of labeled checkboxes for each filter option\n+    //   these checkboxes need to be identified by the value they represent\n+    // The IDs \"value\", \"gt\", \"lt\" and \"eq\" are used to determine in what element in the\n+    // filter object in the column manager we store the value entered by the user\n+    _generateFilteringControls: function(head, col) {\n+      var table = this;\n+      var filter = col.filter;\n+      if (filter.type == \"string\") {","path":"src/plugins/data_table/data_table.js","position":129,"original_position":129,"commit_id":"bb43f44d92a985f9f3b77111f2361d160fe2a179","original_commit_id":"bb43f44d92a985f9f3b77111f2361d160fe2a179","user":{"login":"nburwell","id":372310,"avatar_url":"https://avatars.githubusercontent.com/u/372310?v=3","gravatar_id":"","url":"https://api.github.com/users/nburwell","html_url":"https://github.com/nburwell","followers_url":"https://api.github.com/users/nburwell/followers","following_url":"https://api.github.com/users/nburwell/following{/other_user}","gists_url":"https://api.github.com/users/nburwell/gists{/gist_id}","starred_url":"https://api.github.com/users/nburwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nburwell/subscriptions","organizations_url":"https://api.github.com/users/nburwell/orgs","repos_url":"https://api.github.com/users/nburwell/repos","events_url":"https://api.github.com/users/nburwell/events{/privacy}","received_events_url":"https://api.github.com/users/nburwell/received_events","type":"User","site_admin":false},"body":"more `===` needed in this function","created_at":"2015-06-17T15:19:19Z","updated_at":"2015-06-17T15:19:19Z","html_url":"https://github.com/Invoca/backdraft/pull/26#discussion_r32637998","pull_request_url":"https://api.github.com/repos/Invoca/backdraft/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/Invoca/backdraft/pulls/comments/32637998"},"html":{"href":"https://github.com/Invoca/backdraft/pull/26#discussion_r32637998"},"pull_request":{"href":"https://api.github.com/repos/Invoca/backdraft/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/Invoca/backdraft/pulls/26","id":37603415,"html_url":"https://github.com/Invoca/backdraft/pull/26","diff_url":"https://github.com/Invoca/backdraft/pull/26.diff","patch_url":"https://github.com/Invoca/backdraft/pull/26.patch","issue_url":"https://api.github.com/repos/Invoca/backdraft/issues/26","number":26,"state":"open","locked":false,"title":"83/h/story 2550 Add filtering functionality","user":{"login":"colin-allen","id":12700123,"avatar_url":"https://avatars.githubusercontent.com/u/12700123?v=3","gravatar_id":"","url":"https://api.github.com/users/colin-allen","html_url":"https://github.com/colin-allen","followers_url":"https://api.github.com/users/colin-allen/followers","following_url":"https://api.github.com/users/colin-allen/following{/other_user}","gists_url":"https://api.github.com/users/colin-allen/gists{/gist_id}","starred_url":"https://api.github.com/users/colin-allen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colin-allen/subscriptions","organizations_url":"https://api.github.com/users/colin-allen/orgs","repos_url":"https://api.github.com/users/colin-allen/repos","events_url":"https://api.github.com/users/colin-allen/events{/privacy}","received_events_url":"https://api.github.com/users/colin-allen/received_events","type":"User","site_admin":false},"body":"Added filtering implementation and tests.\r\n@sherriman \r\n@InvokeJLa \r\n@codyjca \r\n\r\nWould you please do a code review!  Thanks, Colin.","created_at":"2015-06-12T20:55:08Z","updated_at":"2015-06-17T15:19:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19146db2485dbb7f8d6835d17f55a635a34633d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Invoca/backdraft/pulls/26/commits","review_comments_url":"https://api.github.com/repos/Invoca/backdraft/pulls/26/comments","review_comment_url":"https://api.github.com/repos/Invoca/backdraft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Invoca/backdraft/issues/26/comments","statuses_url":"https://api.github.com/repos/Invoca/backdraft/statuses/bb43f44d92a985f9f3b77111f2361d160fe2a179","head":{"label":"Invoca:83/h/STORY-2550_Refactor_ReportsController","ref":"83/h/STORY-2550_Refactor_ReportsController","sha":"bb43f44d92a985f9f3b77111f2361d160fe2a179","user":{"login":"Invoca","id":808155,"avatar_url":"https://avatars.githubusercontent.com/u/808155?v=3","gravatar_id":"","url":"https://api.github.com/users/Invoca","html_url":"https://github.com/Invoca","followers_url":"https://api.github.com/users/Invoca/followers","following_url":"https://api.github.com/users/Invoca/following{/other_user}","gists_url":"https://api.github.com/users/Invoca/gists{/gist_id}","starred_url":"https://api.github.com/users/Invoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Invoca/subscriptions","organizations_url":"https://api.github.com/users/Invoca/orgs","repos_url":"https://api.github.com/users/Invoca/repos","events_url":"https://api.github.com/users/Invoca/events{/privacy}","received_events_url":"https://api.github.com/users/Invoca/received_events","type":"Organization","site_admin":false},"repo":{"id":17420609,"name":"backdraft","full_name":"Invoca/backdraft","owner":{"login":"Invoca","id":808155,"avatar_url":"https://avatars.githubusercontent.com/u/808155?v=3","gravatar_id":"","url":"https://api.github.com/users/Invoca","html_url":"https://github.com/Invoca","followers_url":"https://api.github.com/users/Invoca/followers","following_url":"https://api.github.com/users/Invoca/following{/other_user}","gists_url":"https://api.github.com/users/Invoca/gists{/gist_id}","starred_url":"https://api.github.com/users/Invoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Invoca/subscriptions","organizations_url":"https://api.github.com/users/Invoca/orgs","repos_url":"https://api.github.com/users/Invoca/repos","events_url":"https://api.github.com/users/Invoca/events{/privacy}","received_events_url":"https://api.github.com/users/Invoca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Invoca/backdraft","description":"Wrapper around Backbone providing jQuery dataTable integration and plugin framework","fork":false,"url":"https://api.github.com/repos/Invoca/backdraft","forks_url":"https://api.github.com/repos/Invoca/backdraft/forks","keys_url":"https://api.github.com/repos/Invoca/backdraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Invoca/backdraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Invoca/backdraft/teams","hooks_url":"https://api.github.com/repos/Invoca/backdraft/hooks","issue_events_url":"https://api.github.com/repos/Invoca/backdraft/issues/events{/number}","events_url":"https://api.github.com/repos/Invoca/backdraft/events","assignees_url":"https://api.github.com/repos/Invoca/backdraft/assignees{/user}","branches_url":"https://api.github.com/repos/Invoca/backdraft/branches{/branch}","tags_url":"https://api.github.com/repos/Invoca/backdraft/tags","blobs_url":"https://api.github.com/repos/Invoca/backdraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Invoca/backdraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Invoca/backdraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/Invoca/backdraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Invoca/backdraft/statuses/{sha}","languages_url":"https://api.github.com/repos/Invoca/backdraft/languages","stargazers_url":"https://api.github.com/repos/Invoca/backdraft/stargazers","contributors_url":"https://api.github.com/repos/Invoca/backdraft/contributors","subscribers_url":"https://api.github.com/repos/Invoca/backdraft/subscribers","subscription_url":"https://api.github.com/repos/Invoca/backdraft/subscription","commits_url":"https://api.github.com/repos/Invoca/backdraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/Invoca/backdraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/Invoca/backdraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/Invoca/backdraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/Invoca/backdraft/contents/{+path}","compare_url":"https://api.github.com/repos/Invoca/backdraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Invoca/backdraft/merges","archive_url":"https://api.github.com/repos/Invoca/backdraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Invoca/backdraft/downloads","issues_url":"https://api.github.com/repos/Invoca/backdraft/issues{/number}","pulls_url":"https://api.github.com/repos/Invoca/backdraft/pulls{/number}","milestones_url":"https://api.github.com/repos/Invoca/backdraft/milestones{/number}","notifications_url":"https://api.github.com/repos/Invoca/backdraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Invoca/backdraft/labels{/name}","releases_url":"https://api.github.com/repos/Invoca/backdraft/releases{/id}","created_at":"2014-03-04T23:07:25Z","updated_at":"2015-06-07T06:49:30Z","pushed_at":"2015-06-15T18:27:52Z","git_url":"git://github.com/Invoca/backdraft.git","ssh_url":"git@github.com:Invoca/backdraft.git","clone_url":"https://github.com/Invoca/backdraft.git","svn_url":"https://github.com/Invoca/backdraft","homepage":"","size":4016,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":3,"default_branch":"master"}},"base":{"label":"Invoca:master","ref":"master","sha":"74fd5b5fef607c37d50c9d87d4fc0cde506b19f0","user":{"login":"Invoca","id":808155,"avatar_url":"https://avatars.githubusercontent.com/u/808155?v=3","gravatar_id":"","url":"https://api.github.com/users/Invoca","html_url":"https://github.com/Invoca","followers_url":"https://api.github.com/users/Invoca/followers","following_url":"https://api.github.com/users/Invoca/following{/other_user}","gists_url":"https://api.github.com/users/Invoca/gists{/gist_id}","starred_url":"https://api.github.com/users/Invoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Invoca/subscriptions","organizations_url":"https://api.github.com/users/Invoca/orgs","repos_url":"https://api.github.com/users/Invoca/repos","events_url":"https://api.github.com/users/Invoca/events{/privacy}","received_events_url":"https://api.github.com/users/Invoca/received_events","type":"Organization","site_admin":false},"repo":{"id":17420609,"name":"backdraft","full_name":"Invoca/backdraft","owner":{"login":"Invoca","id":808155,"avatar_url":"https://avatars.githubusercontent.com/u/808155?v=3","gravatar_id":"","url":"https://api.github.com/users/Invoca","html_url":"https://github.com/Invoca","followers_url":"https://api.github.com/users/Invoca/followers","following_url":"https://api.github.com/users/Invoca/following{/other_user}","gists_url":"https://api.github.com/users/Invoca/gists{/gist_id}","starred_url":"https://api.github.com/users/Invoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Invoca/subscriptions","organizations_url":"https://api.github.com/users/Invoca/orgs","repos_url":"https://api.github.com/users/Invoca/repos","events_url":"https://api.github.com/users/Invoca/events{/privacy}","received_events_url":"https://api.github.com/users/Invoca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Invoca/backdraft","description":"Wrapper around Backbone providing jQuery dataTable integration and plugin framework","fork":false,"url":"https://api.github.com/repos/Invoca/backdraft","forks_url":"https://api.github.com/repos/Invoca/backdraft/forks","keys_url":"https://api.github.com/repos/Invoca/backdraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Invoca/backdraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Invoca/backdraft/teams","hooks_url":"https://api.github.com/repos/Invoca/backdraft/hooks","issue_events_url":"https://api.github.com/repos/Invoca/backdraft/issues/events{/number}","events_url":"https://api.github.com/repos/Invoca/backdraft/events","assignees_url":"https://api.github.com/repos/Invoca/backdraft/assignees{/user}","branches_url":"https://api.github.com/repos/Invoca/backdraft/branches{/branch}","tags_url":"https://api.github.com/repos/Invoca/backdraft/tags","blobs_url":"https://api.github.com/repos/Invoca/backdraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Invoca/backdraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Invoca/backdraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/Invoca/backdraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Invoca/backdraft/statuses/{sha}","languages_url":"https://api.github.com/repos/Invoca/backdraft/languages","stargazers_url":"https://api.github.com/repos/Invoca/backdraft/stargazers","contributors_url":"https://api.github.com/repos/Invoca/backdraft/contributors","subscribers_url":"https://api.github.com/repos/Invoca/backdraft/subscribers","subscription_url":"https://api.github.com/repos/Invoca/backdraft/subscription","commits_url":"https://api.github.com/repos/Invoca/backdraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/Invoca/backdraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/Invoca/backdraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/Invoca/backdraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/Invoca/backdraft/contents/{+path}","compare_url":"https://api.github.com/repos/Invoca/backdraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Invoca/backdraft/merges","archive_url":"https://api.github.com/repos/Invoca/backdraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Invoca/backdraft/downloads","issues_url":"https://api.github.com/repos/Invoca/backdraft/issues{/number}","pulls_url":"https://api.github.com/repos/Invoca/backdraft/pulls{/number}","milestones_url":"https://api.github.com/repos/Invoca/backdraft/milestones{/number}","notifications_url":"https://api.github.com/repos/Invoca/backdraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Invoca/backdraft/labels{/name}","releases_url":"https://api.github.com/repos/Invoca/backdraft/releases{/id}","created_at":"2014-03-04T23:07:25Z","updated_at":"2015-06-07T06:49:30Z","pushed_at":"2015-06-15T18:27:52Z","git_url":"git://github.com/Invoca/backdraft.git","ssh_url":"git@github.com:Invoca/backdraft.git","clone_url":"https://github.com/Invoca/backdraft.git","svn_url":"https://github.com/Invoca/backdraft","homepage":"","size":4016,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Invoca/backdraft/pulls/26"},"html":{"href":"https://github.com/Invoca/backdraft/pull/26"},"issue":{"href":"https://api.github.com/repos/Invoca/backdraft/issues/26"},"comments":{"href":"https://api.github.com/repos/Invoca/backdraft/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/Invoca/backdraft/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/Invoca/backdraft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Invoca/backdraft/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/Invoca/backdraft/statuses/bb43f44d92a985f9f3b77111f2361d160fe2a179"}}}}