My problem is not adding items to the listview. The problem is that it doesn't look like it should, like the listview in Clean up Modules. It looks like I show in the picture above. Compare with the list in Clean up modules.
This is the code from RefreshModulesList that adds item to that list in _maintenance.js
$('#configure_interfaces_modules_list').append($('<li/>', {
'data-icon': 'minus',
'data-context-domain': mod.Domain,
'data-context-address': mod.Address
})
.append($('<a/>',
{
'text': mod.Address + ' ' + mod.Name
})));
When looking at the HTML code created by this you get, for the first two lines of the listview:
<ul class="ui-listview" id="configure_interfaces_modules_list" data-role="listview">
<li class="ui-li-divider ui-bar-inherit ui-first-child" role="heading" data-role="list-divider">Favourites.Link</li>
<li data-context-address="1" data-context-domain="Favourites.Link" data-icon="minus">
<a class="ui-btn ui-btn-icon-right ui-icon-minus">1 DIY HomeGenie Server</a>
</li>
The code I have in GetModulesListVireItems, _groupmodules.js:
$('#automation_group_module_list').append($('<li/>', {
'data-icon': 'minus',
'data-context-domain': module.Domain,
'data-context-address': module.Address
})
.append($('<a/>',
{
'text': module.Address + ' ' + (module.Name != '' ? module.Name : (module.Description != '' ? module.Description : module.DeviceType))
})));
Produces this kind of listview rows:
<ul class="ui-listview" id="automation_group_module_list" data-role="listview">
<li data-role="list-divider">Favourites.Link</li>
<li data-context-address="1" data-context-domain="Favourites.Link" data-icon="minus">
<a>1 DIY HomeGenie Server</a>
</li>
As you can see, the HTML that my code produces is missing
class="ui-li-divider ui-bar-inherit ui-first-child" role="heading"
in the divider.
And
class="ui-btn ui-btn-icon-right ui-icon-minus"
in the link.
For me as a JS/HTML newbie it should produce the same kind of looking lists, but it doesn't. Therefore I thought that there was a problem with the properties for the whole list. Inheritance or something.