I tried creating a listview with listitems that have a button on the right side. Just like a jQuery Mobile split button listview, but only the right button should be clickable. The left part should contain a label together with a text input.
I found this answer: https://stackoverflow.com/a/15292521/2026623
But the class used in this answer was removed/renamed in jQuery mobile 1.4.0. I found out that some of the properties are now in .ui-btn-a but not all.
So I tried implementing it myself (having little knowledge of CSS). This is what it looks so far:
HTML:
<li class="readonly-li-a">
<a class="readonly-btn-a ui-field-contain">
<label for="boss">Boss:</label>
<input type="text" id="boss" name="boss">
</a>
<a data-role="button" data-inline="true" data-icon="bars" data-iconpos="notext"></a>
</li>
CSS:
.readonly-btn-a {
background: #fff!important /*{a-bup-background-color}*/;
color: #333!important /*{a-bup-color}*/;
text-shadow: 0 /*{a-bup-shadow-x}*/ 1px /*{a-bup-shadow-y}*/ 0 /*{a-bup-shadow-radius}*/ #f3f3f3 /*{a-bup-shadow-color}*/;
cursor: default !important; /* don't change to hand cursor */
border: none !important;
}
.readonly-li-a {
border: 0 solid #ddd !important;
border-top-width: 1px !important; /*the line above the li */
padding: .7em 1em !important; /*copied from .ui-li-static */
background: #fff!important; /*white background instead of grey*/
margin: 0 1px!important; /*the li stands out by 1px left/right without this*/
-webkit-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/;
-moz-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/;
box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/;
}
And this is what it looks in action: http://jsfiddle.net/MasterQuestMaster/QJ9m2/
There are 2 problems with this solution and I hope someone can help me solving them.
- If you enter the text field, the blue shine gets cut off by the border of the -Tag. I think this is because of the padding I added to .readonly-li-a.
- The text input is not aligned correctly (the label is though)
Or maybe somebody even has tried this before me and found a better solution. If so, please post it.