코드를 실행할 때 중복되는 내용이 표시되는 이유는 무엇입니까? 다시 실행시 이전 레코드를 제거하기 위해 empty()를 사용하고 있지만 작동하지 않는 것 같습니다.중복 레코드 표시
여기 내 코드입니다 : 당신은 함수 내부 this
참조하고
function listClass() {
this.formOrderList = null;
this.orderListDialogObject = $('<div id="mainDiv"></div>');
this.orderListTable = $('<div>'
+ '<table id="orderListTable" class="ui-widget tblBorder" width="100%" border="0" cellspacing="1" cellpadding="2">'
+ '<thead class="ui-widget-header" id="orderListHead">' + '<tr>'
+ '<th><strong> Order# </strong></th>'
+ '<th><strong> Symbol </strong></th>'
//+ '<th><strong> Exchange </strong></th>'
//+ '<th><strong> Market </strong></th>'
+ '<th><strong> Time </strong></th>'
+ '<th><strong> Order Type </strong></th>'
+ '<th><strong> Side </strong></th>'
+ '<th><strong> Volume </strong></th>'
+ '<th><strong> Price </strong></th>'
+ '<th><strong> Trigger Price </strong></th>'
+ '<th><strong> Filled Volume </strong></th>'
+ '<th><strong> Status </strong></th>'
+ '<th><strong> Expiry Date </strong></th>'
+ '<th><strong> Ref # </strong></th>'
+ '<th><strong> Action </strong></th>' + '</tr>' + '</thead>'
+ '<tbody id="orderListBody">' + '</tbody>' + '</table>' + '</div>');
this.orderListTabs = $('<div>' + '<ul>'
+ '<li><a href="#pendingOrderList">Pending</a></li>' + '</ul>'
+ '<div id="pendingOrderList">' + '</div>' + '</div>');
this.orderListDialogObject.appendTo("body");
this.show = function() {
$("#orderListBody", this.orderListTable).empty();
this.orderListDialogObject.dialog({
title : 'Order List',
width : 850,
height : 150,
close : function(ev, ui) {
$(this).remove();
return false;
/*$(this).dialog('destroy').remove();
return false;*/
}
});
this.orderListTabs.tabs();
this.orderListTabs.appendTo(this.orderListDialogObject);
$("#pendingOrderList", this.orderListTabs).append(this.orderListTable);
}
[예] (http://jsfiddle.net/pnNNU/) 코드와,하지만 HTTP ([보기] 수 없습니다 : // jsfiddle을 .net/pnNNU/show /) 중복 콘텐츠. – scessor
scessor in thead, tbody에서는 중복 된 내용을 표시합니다. –
그리고 어떤 함수가'tbody'를 채 웁니 까? [이 예제에서는] (http://jsfiddle.net/pnNNU/1/show/) ([코드는 여기에 (http://jsfiddle.net/pnNNU/1/)) 채워진 예제를 볼 tbody 중복 콘텐츠에 대해서는 아무런 문제가 없습니다. – scessor