开发者

Cannot a Back button to nested list (Latest Version)

开发者 https://www.devze.com 2023-03-10 09:41 出处:网络
I\'m having problems trying to get the back button to show in a nexted list. I can see that the same is happening to your demo\'s here:

I'm having problems trying to get the back button to show in a nexted list. I can see that the same is happening to your demo's here:

http://j开发者_Python百科querymobile.com/test/#/test/docs/lists/lists-nested.html

You can see the problem here:

http://jquerymobile.com/test/#/test/docs/lists/lists-nested.html&ui-page=Animals-8

or just click any list.

Here is my actually issue:

<ul data-role="listview" data-inset="true">';
<li data-icon="info">
<h3 class="ui-li-heading">Heading here</h3>
<p class="ui-li-desc">Author:&nbsp;<strong>some author</strong></p>
<p class="ui-li-desc">Description:&nbsp;<strong>some description</strong></p>

            <ul data-role="listview" data-inset="true" data-add-back-btn="true">
                <li>sometthing here</li>
            </ul>

</li>
</ul>

Is this a bug or I'm I forgetting something?

Thanks

UPDATE: Another example:

<ul data-role='listview'>
            <li>
                <li><div>Some Text</div><p>ddd</p>
                    <ul data-role='listview'>

                        <li>
                            some text here
                        </li>

                    </ul>
                </li>
            </li>
        </ul>   

No back button. How do I make the back button appear?


To reenable the back button simply add data-add-back-btn="true" to the page container:

Related: JQuery Mobile Latest 03 June 2011 Version - No back button

You are using the tests and not the demo, so I guess this would be the latest (or close to) build.

  • http://jquerymobile.com/test/#/test/docs/lists/lists-nested.html
  • http://jquerymobile.com/demos/1.0a4.1/#docs/lists/index.html

UPDATE:

  • http://jquerymobile.com/test/docs/toolbars/docs-headers.html

Adding Back buttons

jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app web view. The framework automatically generates a "back" button on a header when the page plugin's addBackBtn option is true. This can also be set via markup if the page div has a data-add-back-btn="true" attribute.

If you use the attribute data-rel="back" on an anchor, any clicks on that anchor will mimic the back button, going back one history entry and ignoring the anchor's default href. This is particularly useful when linking back to a named page, such as a link that says "home", or when generating "back" buttons with JavaScript, such as a button to close a dialog. When using this feature in your source markup, be sure to provide a meaningful href that actually points to the URL of the referring page (this will allow the feature to work for users in C-Grade browsers. Also, please keep in mind that if you just want a reverse transition without actually going back in history, you should use the data-direction="reverse" attribute instead.

Maybe try:

$(document).bind("mobileinit", function(){
    $.mobile.page.prototype.options.addBackBtn = true;
});
0

精彩评论

暂无评论...
验证码 换一张
取 消