This should be another simple fix that is confusing me. I’m pulling data from a database and rendering a button for each row of the database. However, the text doesn’t appear inside the button! It appears underneath it!
Here’s the code:
$('#'+category).append('<li><a href="#itemColours" data-role="button" data-icon="false" data-rel="popup" data-mini="true" id="'+thisRow.fixture+'itemColour" class="descriptions" onClick="getItemColours(\''+thisRow.fixture+'\')" />'+thisRow.colour+'</a></li>');
Interestingly, when the getItemColours function runs, it shows a popup of colours and when you select one it changes the button and updates the database. That bit works just fine.
$('#'+item+'itemColour .ui-btn-text').text(colour);
here’s what I get: http://i1320.photobucket.com/albums/u521/dan_jones2/buttons_zps185113ce.png
The button rendered incorrectly, the button after the function call (correct) and then the button after the list is refreshed (incorrect again).
I still don’t know why this wasn’t working but I got around it by changing the anchor tag for an input button and added another function to open the popup.