2017-09-12 1 views
0

이 명령을 사용하여 내 테이블에 ID 중 하나를 제공했지만 작동하지 않습니다.removeByUniqueId가 내 부트 스트랩 테이블에서 작동하지 않습니까?

$table.bootstrapTable('removeByUniqueId', "ID"); 


$("#deleteUrl").click(function() { 
    alert("Handler for .click() called."); 
    $('#servicetable').bootstrapTable('removeByUniqueId', "test"); 
}); 

여기 내 테이블에 #deleteUrl is my delete button ID and "test" is one of the ID's.

나는 사전에이 구문에 대한

http://issues.wenzhixin.net.cn/bootstrap-table/#methods/removeByUniqueId.html

덕분에이 링크에 대해 참조!

답변

0

나는 이렇게했다. 테이블에 data-unique-id="My-id"을 추가했습니다.

<table class="table-striped" id="servicetable" data-unique-id="hostname" data-search="true" data-show-refresh="true" data-show-columns="true" data-pagination="true" > 

나는 내 테이블에이 My-id을 고유하게 가지고 있습니다.

그래서 여기에 액세스하여 행을 삭제하십시오. 마침내 나는했다!

$table.bootstrapTable('removeByUniqueId', "DEMO UPGRADE");