{"action":"created","issue":{"url":"https://api.github.com/repos/olifolkerd/tabulator/issues/143","repository_url":"https://api.github.com/repos/olifolkerd/tabulator","labels_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/143/comments","events_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/143/events","html_url":"https://github.com/olifolkerd/tabulator/issues/143","id":197259189,"number":143,"title":"dataFiltered function not working properly","user":{"login":"LastExile16","id":24633041,"avatar_url":"https://avatars.githubusercontent.com/u/24633041?v=3","gravatar_id":"","url":"https://api.github.com/users/LastExile16","html_url":"https://github.com/LastExile16","followers_url":"https://api.github.com/users/LastExile16/followers","following_url":"https://api.github.com/users/LastExile16/following{/other_user}","gists_url":"https://api.github.com/users/LastExile16/gists{/gist_id}","starred_url":"https://api.github.com/users/LastExile16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LastExile16/subscriptions","organizations_url":"https://api.github.com/users/LastExile16/orgs","repos_url":"https://api.github.com/users/LastExile16/repos","events_url":"https://api.github.com/users/LastExile16/events{/privacy}","received_events_url":"https://api.github.com/users/LastExile16/received_events","type":"User","site_admin":false},"labels":[{"id":277350038,"url":"https://api.github.com/repos/olifolkerd/tabulator/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"olifolkerd","id":6840524,"avatar_url":"https://avatars.githubusercontent.com/u/6840524?v=3","gravatar_id":"","url":"https://api.github.com/users/olifolkerd","html_url":"https://github.com/olifolkerd","followers_url":"https://api.github.com/users/olifolkerd/followers","following_url":"https://api.github.com/users/olifolkerd/following{/other_user}","gists_url":"https://api.github.com/users/olifolkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/olifolkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olifolkerd/subscriptions","organizations_url":"https://api.github.com/users/olifolkerd/orgs","repos_url":"https://api.github.com/users/olifolkerd/repos","events_url":"https://api.github.com/users/olifolkerd/events{/privacy}","received_events_url":"https://api.github.com/users/olifolkerd/received_events","type":"User","site_admin":false},"assignees":[{"login":"olifolkerd","id":6840524,"avatar_url":"https://avatars.githubusercontent.com/u/6840524?v=3","gravatar_id":"","url":"https://api.github.com/users/olifolkerd","html_url":"https://github.com/olifolkerd","followers_url":"https://api.github.com/users/olifolkerd/followers","following_url":"https://api.github.com/users/olifolkerd/following{/other_user}","gists_url":"https://api.github.com/users/olifolkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/olifolkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olifolkerd/subscriptions","organizations_url":"https://api.github.com/users/olifolkerd/orgs","repos_url":"https://api.github.com/users/olifolkerd/repos","events_url":"https://api.github.com/users/olifolkerd/events{/privacy}","received_events_url":"https://api.github.com/users/olifolkerd/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-12-22T20:22:21Z","updated_at":"2016-12-22T23:15:35Z","closed_at":null,"body":"Hi Oli\r\nthe function \r\n```javascript \r\ndataFiltered:function(data, field, type, value) {\r\n        console.log(\"field: \"+field+\" with data \"+value);\r\n},\r\n``` \r\nnot receiving the variables field and value, the output for the above code is\r\n```javascript\r\nfunction colFilter(data){\r\n\tvar match = true;\r\n\r\n\tfor(var field in filters){\r\n\t\tif(typeof data[field] == \"string\"){\r\n\t\t\tif(data[field].toLowerCase().indexOf(filters[field].toLowerCase()) == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t    //match everything else explicitly\r\n\t\t    if(data[field] != filters[field]){\r\n\t\t    \tmatch = false;\r\n\t\t    }\r\n\t\t}\r\n\t}\r\n\r\n\treturn match;\r\n} with data undefined\r\n```\r\nas you can see the field is returning a function and data returning undefined\r\nI don't know what is the matter could you check it, please?\r\nThank you"},"comment":{"url":"https://api.github.com/repos/olifolkerd/tabulator/issues/comments/268911789","html_url":"https://github.com/olifolkerd/tabulator/issues/143#issuecomment-268911789","issue_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/143","id":268911789,"user":{"login":"olifolkerd","id":6840524,"avatar_url":"https://avatars.githubusercontent.com/u/6840524?v=3","gravatar_id":"","url":"https://api.github.com/users/olifolkerd","html_url":"https://github.com/olifolkerd","followers_url":"https://api.github.com/users/olifolkerd/followers","following_url":"https://api.github.com/users/olifolkerd/following{/other_user}","gists_url":"https://api.github.com/users/olifolkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/olifolkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olifolkerd/subscriptions","organizations_url":"https://api.github.com/users/olifolkerd/orgs","repos_url":"https://api.github.com/users/olifolkerd/repos","events_url":"https://api.github.com/users/olifolkerd/events{/privacy}","received_events_url":"https://api.github.com/users/olifolkerd/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T23:15:35Z","updated_at":"2016-12-22T23:15:35Z","body":"This is because you are using header filters. In this case a custom filter callback is used (to combine multiple possible header filters), which is the function that is being passed to the field argument of the ***dataFiltered*** callback.\r\n\r\nIn this situation it is not possible to access the filter fields directly, as the filter is applied as a sum of all of the filtered fields.\r\n\r\nWhat you can do instead is iterate through all of the headers in when the ***dataFiltered*** callback is triggered to check which ones have a value:\r\n```js\r\n$(\"#example-table .tabulator-header-filter input\").each(function(){\r\n    var value = $(this).val();\r\n\r\n    if (value !== \"\"){\r\n        //process filtered field\r\n    }\r\n});\r\n```\r\n\r\nin this example we only iterated through input element filters, but you could adjust this to include select elements etc if needed.\r\n\r\nIncidentally, it looks like you are using an old version of Tabulator, I would suggest downloading the latest version as there have been significant improvements to the header filters in the last week.\r\n\r\nLet me know if this helps you out.\r\n\r\nCheers\r\n\r\nOli"}}
{"actor":{"display_login":"olifolkerd"}}