{"action":"closed","issue":{"url":"https://api.github.com/repos/vedmack/yadcf/issues/372","repository_url":"https://api.github.com/repos/vedmack/yadcf","labels_url":"https://api.github.com/repos/vedmack/yadcf/issues/372/labels{/name}","comments_url":"https://api.github.com/repos/vedmack/yadcf/issues/372/comments","events_url":"https://api.github.com/repos/vedmack/yadcf/issues/372/events","html_url":"https://github.com/vedmack/yadcf/issues/372","id":193605766,"number":372,"title":"JQMobile issue: Cannot read property 'mData' of undefined","user":{"login":"chrismaliszewski","id":7532602,"avatar_url":"https://avatars.githubusercontent.com/u/7532602?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismaliszewski","html_url":"https://github.com/chrismaliszewski","followers_url":"https://api.github.com/users/chrismaliszewski/followers","following_url":"https://api.github.com/users/chrismaliszewski/following{/other_user}","gists_url":"https://api.github.com/users/chrismaliszewski/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismaliszewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismaliszewski/subscriptions","organizations_url":"https://api.github.com/users/chrismaliszewski/orgs","repos_url":"https://api.github.com/users/chrismaliszewski/repos","events_url":"https://api.github.com/users/chrismaliszewski/events{/privacy}","received_events_url":"https://api.github.com/users/chrismaliszewski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-05T20:47:26Z","updated_at":"2016-12-05T22:05:45Z","closed_at":"2016-12-05T22:05:45Z","body":"Hi.\r\n\r\nI have a big problem with JQMobile and YADCF. \r\n\r\nStandard behaviour of JQM is load content with AJAX calls to prevent reloading a page completely. Therefore, I had many problems with DT related to reinitiate tables, but I bypassed it by removing previously loaded page from HTML code with\r\n`$(document).on('pagehide', function(event){\r\n\t$(event.target).remove();\r\n});`\r\nDT works perfectly now but when I add YADCF there is a problem. \r\n\r\nScenario:\r\n1. Open a page, init DT, init YADCF, for me it's something like:\r\nvar $dataTable = $(app.dataTableSelector);\r\n$dataTable = $dataTable.DataTable ({\r\n\tdata : items,\r\n\tlengthChange: false,\r\n\tcolumns : [\r\n\t\t{ data : 'iid', title: \"IId\", \"visible\": false},\r\n\t\t{ data : 'partno', title: \"Part No.\", class: 'details-control all'},\r\n\t\t{ data : 'barcode', title: \"Barcode\", class: \"all\"},\r\n\t\t{ data : 'description', title: \"Description\", class: \"all\"}\r\n\t]\r\n})\r\n\t\r\nyadcf.init($dataTable, \r\n\t[\r\n\t\t{column_number : 1, filter_type: \"text\", filter_container_id: \"dataTables_filter_partno\"},\r\n\t\t{column_number : 2, filter_type: \"text\", filter_container_id: \"dataTables_filter_barcode\"},\r\n\t\t{column_number : 3, filter_type: \"text\", filter_container_id: \"dataTables_filter_description\"}\r\n\t]\r\n);\r\n\r\n2. Open another website with different DT (which contains different list of columns) in the same way as in 1.. \r\nIn that point I get an error: ERROR: Filter container could not be found, columnObj.filter_container_selector: #column_name\r\n\r\n3. Go back to the first website; it will load the code in the same way as in 1..\r\nOur journey ends with DataTable constructor and error message: Uncaught TypeError: Cannot read property 'mData' of undefined(…)\r\n\r\nProblem is in leaving references in DT by YADCF to the old, non-existing columns of previous DT.\r\nDestroying all DT doesn't help\r\n`var tables = $.fn.dataTable.fnTables(true);\r\n\t\t$(tables).each(function () {\r\n\t\t\t$(this).dataTable().fnDestroy();\r\n\t\t});`\r\n\r\nDon't know how to solve that issue. \r\nCan anyone help?\r\nThank you in advance!"}}
{"actor":{"display_login":"chrismaliszewski"}}