Partial fix for FELIX-2286 /Various rendering issues with IE/
https://issues.apache.org/jira/browse/FELIX-2286
fixes component and services plugins
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@934380 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/res/ui/services.js b/webconsole/src/main/resources/res/ui/services.js
index 2dfbf07..531c600 100644
--- a/webconsole/src/main/resources/res/ui/services.js
+++ b/webconsole/src/main/resources/res/ui/services.js
@@ -14,6 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+var tableEntryTemplate = false;
+var tableBody = false;
function renderData(eventData) {
$('.statline').empty().append(i18n.statline.msgFormat(eventData.serviceCount));
@@ -21,52 +23,22 @@
for ( var idx in eventData.data) {
entry(eventData.data[idx]);
}
- $('#plugin_table').trigger('update');
if (drawDetails) {
renderDetails(eventData);
}
}
function entry( /* Object */dataEntry) {
- var trElement = tr(null, {
- id : 'entry' + dataEntry.id
- });
- entryInternal(trElement, dataEntry);
- $('#plugin_table > tbody').append(trElement);
-}
-
-function entryInternal( /* Element */parent, /* Object */dataEntry) {
var id = dataEntry.id;
var name = dataEntry.id;
- // right arrow
- var inputElement = createElement('span', 'ui-icon ui-icon-triangle-1-e', {
- title: i18n.detailsTip,
- id: 'img' + id,
- style: {display: 'inline-block'}
- });
-
- $(inputElement).click(function() {
- showDetails(id)
- });
- var titleElement;
- if (drawDetails) {
- titleElement = text(name);
- } else {
- titleElement = createElement('a', null, {
- href : window.location.pathname + '/' + id
- });
- titleElement.appendChild(text(name));
- }
- var bundleElement = createElement('a', null, {
- href : bundlePath + dataEntry.bundleId
- });
- bundleElement.appendChild(text(dataEntry.bundleSymbolicName + ' ('
- + dataEntry.bundleId + ')'));
-
- parent.appendChild(td(null, null, [ inputElement, text(' '), titleElement ]));
- parent.appendChild(td(null, null, [ text(dataEntry.types) ]));
- parent.appendChild(td(null, null, [ bundleElement ]));
+ var _ = tableEntryTemplate.clone().attr('id', 'entry' + id).appendTo(tableBody);
+ _.find('.bIcon').attr('id', 'img' + id).click(function() {
+ showDetails(id);
+ }).after(drawDetails ? name : ('<a href="' + window.location.pathname + '/' + id + '">' + name + '</a>'));
+
+ _.find('td:eq(1)').text(dataEntry.types);
+ _.find('td:eq(2)').html('<a href="' + bundlePath + dataEntry.bundleId + '">' + dataEntry.bundleSymbolicName + ' (' + dataEntry.bundleId + ')</a>' );
}
function showDetails(id) {
@@ -174,17 +146,19 @@
return txt;
}
-function renderServices(data) {
- $(document).ready(function() {
- renderData(data);
- $('#plugin_table').tablesorter( {
- headers : {
- 0 : { sorter : 'digit' }
- },
- sortList : [ [ 1, 0 ] ],
- textExtraction : mixedLinksExtraction,
- widgets: ['zebra']
- });
+$(document).ready(function() {
+ tableBody = $('#plugin_table tbody');
+ tableEntryTemplate = tableBody.find('tr').clone();
+ tableBody.empty();
+
+ renderData(data);
+
+ $('#plugin_table').tablesorter( {
+ headers : {
+ 0 : { sorter : 'digit' }
+ },
+ sortList : [ [ 1, 0 ] ],
+ textExtraction : mixedLinksExtraction
});
-}
\ No newline at end of file
+});