28

In jquery mobile, you deal with data-roles a lot. Is there a list of all data-roles in jquery-mobile? I think I would find that helpful.

4 Answers 4

37

After the 1.0 release there is now an official reference page for data attributes (including roles).

2
  • 14
    To improve the quality of this question, this should be marked as the correct anser. Mine is potentially out-dated and incorrect.
    – Jason Dean
    Mar 20, 2012 at 20:54
  • 1
    The link in your answer is out of date now, it should be updated to api.jquerymobile.com/data-attribute Mar 11, 2013 at 14:38
23

This is the best list I can find.

source: http://api.jquerymobile.com/data-attribute/

data-add-back-btn 
data-ajax 
data-back 
data-back-btn-text 
data-collapsed 
data-count-theme 
data-direction 
data-divider-theme 
data-dividertheme 
data-filter 
data-filter-theme 
data-fullscreen 
data-grid 
data-icon 
data-iconpos 
data-id 
data-inline 
data-inset 
data-mynamespace-foo 
data-native 
data-native-menu 
data-placeholder 
data-position 
data-rel 
data-role 
data-split-icon 
data-split-theme 
data-theme 
data-track-theme 
data-transition 
data-type 
data-url 
2
  • 2
    Thank you! The documentation is hard to navigate.
    – Joe
    Oct 8, 2011 at 14:01
  • 1
    I noticed that the link provided does have a data-role entry ... but the data-role entry does Not describe data-role="popup" ... there could be other values that are not included.
    – dsdsdsdsd
    Feb 1, 2013 at 11:18
9

As Joe says, the documentation is hard to navigate we most developers are used to do. There is not all possible values for data-role attribute documented. You have to figure it out by reading the whole page.

So in my willing to help, this is what I got from documentation page:

data-role possible values:

  • button
  • collapsible
  • collapsible-set
  • content
  • field-contain
  • slider
  • footer
  • header
  • listview
  • navbar
  • page

hope this helps, hope jquery update its doc page.

1
  • add these in here : dialog popup
    – user2805663
    Dec 7, 2013 at 2:44
1

You can add your own data-role values for styling and extension purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.