{"issue":{"state":"closed","created_at":"2011-11-23T13:43:05Z","updated_at":"2011-12-13T00:04:33Z","comments":2,"user":{"gravatar_id":"430991b22a96d87c7880046590f22dbe","id":729888,"url":"https://api.github.com/users/frequent","login":"frequent","avatar_url":"https://secure.gravatar.com/avatar/430991b22a96d87c7880046590f22dbe?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"On trying to remove my leftover page() calls with trigger('create') I noticed some changes - most notably stuff not working anymore... \r\n\r\nIf I take a simple page to enhance: \r\n\r\n    <div data-role=\"page\" id=\"popover3-1\" data-theme=\"a\">\r\n\t\t<div data-role=\"header\" data-position=\"fixed\" data-theme=\"a\">\r\n\t \t\t<h1>Popover3</h1>\r\n\t\t</div>\r\n\t\t<div data-role=\"content\">\t\t\t\t\r\n\t\t\t<ul data-role=\"listview\" data-inset=\"true\">\r\n\t\t\t\t<li><a href=\"#popover3-2\"><span>Popover3 page2</span></a></li>\r\n\t\t\t\t<li><a href=\"#popover3-1\"><span>Popover3 page3</span></a></li>\r\n\t\t\t</ul>\t\t\t\t\t\t\r\n\t\t</div>\r\n\t</div>\r\n\r\ncalling _trigger('create')_ doesn't get me anywhere to the enhanced page, most notable because the page is missing classes: _ui-page, ui-body-a_ \r\n\r\nSay I want to inject new pages into a multipage app programmatically, is there no way to trigger('create') the whole page or am I missing something completely?\r\n\r\n**EDIT:**\r\nI also tried calling \"pagecreate\", which returns to _$page.data( \"page\" )_ is undefined.\r\nCalling \"create\", adding missing classes by hand and trying to transition to a new page returns _fromPage.data(\"page\")_ is undefined. \r\n\r\nThanks. \r\n\r\n\r\n     \r\n    \r\n","assignee":null,"id":2329697,"number":3149,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"calling trigger('create') on a page vs. calling page()","html_url":"https://github.com/jquery/jquery-mobile/issues/3149","closed_at":"2011-12-13T00:04:33Z","url":"https://api.github.com/repos/jquery/jquery-mobile/issues/3149","milestone":null},"action":"created","comment":{"created_at":"2011-12-13T00:04:32Z","updated_at":"2011-12-13T00:04:32Z","user":{"gravatar_id":"430991b22a96d87c7880046590f22dbe","id":729888,"url":"https://api.github.com/users/frequent","login":"frequent","avatar_url":"https://secure.gravatar.com/avatar/430991b22a96d87c7880046590f22dbe?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"@jblas  \r\n\r\nthanks for the detailed explanation. I looked up my code in question again. I had hoped for an automatic-enhancement as you described, but when setting up my plugin, the default pages (_jqmData(data-show=\"first\")_) on every panel did not enhance. I guess this is because the panels containing these pages are wrapped in a JQM-page, which did get enhanced, so subsequent pagecreate events don't fire for a seemingly reason. \r\n\r\nI tried&errored my way to this:\r\n\r\n     firstPage=$('div:jqmData(role=\"panel\") > div:jqmData(show=\"first\")')\r\n           .addClass($.mobile.activePageClass).trigger('create').page();\r\n\r\nwhich works.\r\n\r\nI had hoped to get by without calling page(), because it seemed to mess up other parts of the plugin, but once I could make sure, the above only fired once, everything was ok. \r\n\r\nSo I guess I can close. Thx again. ","id":3116459,"url":"https://api.github.com/repos/jquery/jquery-mobile/issues/comments/3116459"}}