Problem with changing listview item icon

Problem with changing listview item icon

I want to change the listview item icon from data-icon="false" to data-icon="check" for example dynamically.  I have tried many way but while I can query the selector after I set it and it has changed, the actual element does not get an icon. Using jqm 1.45.

  1. <ul data-role="listview" id=test">
  2. <li data-icon="false">Line Item</li>
  3. </ul>
This is the code that I tried:

  1. $( "#test li" ).listview("option", "icon", "check");
  2. $( "#test" ).listview("refresh");