에서 tabletogrid 함수를 사용하려고합니다. 내 문제는 테이블의 행을 삭제하면 표 셀의 너비 특성이 사라지는 것입니다. 그러나 마지막 행이 삭제 된 경우 삭제 작업은 예상대로 발생합니다. jqGrid TableToGrid 행을 삭제
<table id="item_table">
<thead>
<tr>
<th width="60">Date</th>
<th width="15">Icon</th>
<th width="80">Shop</th>
<th width="15">Delete</th>
</tr>
<thead>
<tbody>
<tr>
<td width="60" class="col_date">
<div class="date"></div>
</td>
<td width="15" class="col_icon">
<div class="icon"></div>
</td>
<td width="80" class="col_shop">
<div class="shop"></div>
</td>
<td width="25" class="col_delete">
<div class="delete"></div>
</td>
</tr>
</tbody>
</table>
가 그럼 난 아약스 코드를 사용하여 테이블에 내용을 추가 - 예를 들어, 여기 내 HTML 테이블입니다. 그 다음에는 jqgrid 설정이 있습니다.
jQuery.extend(jQuery.jgrid.defaults, {
caption: "Shops",
autowidth: true,
height: 24,
hidegrid: false,
onCellSelect: function(rowid, index, contents, target) {
if (index == 3) {
$('#item_table tr:eq(' + rowid + ')').remove();
}
},
colModel:[
{ name: 'date', index: 'date', width: 0, resizable: false },
{ name: 'icon', index: 'icon', width: 0, resizable: false },
{ name: 'shop', index: 'shop', width: 0, resizable: false },
{ name: 'delete', index: 'delete', width: 0, resizable: false }
]
});
tableToGrid("#item_table", {
colNames: ['Date', '', 'Shop', 'Delete']
});
삭제 작업으로 인해 너비 특성이 사라집니다. 왜 이런 일이 일어나는 걸까요? 그리드의
세포는 ....
<TD style="WIDTH: 80px" title="" role=gridcell><DIV class=shop></DIV></TD>
마지막 행을 제외한 모든 행을 삭제하면
은, 세포가이처럼되고 ... 이런 식으로 표시 얻을<TD title="" role=gridcell><DIV class=shop></DIV></TD>
폭 속성 제거됩니다. 내가 여기서 무엇을 놓치고 있니?