2017-07-29 7 views
0

私は天気をチェックするコードを書くことができます。どの列もデータテーブルに存在するかどうかチェックしてください。データテーブルに行があるか空であるかを調べる

$('#del').click(function() { 
 

 
       
 
       tab.row('.selected').remove().draw(); 
 
       
 
      if(window.clck===true){ 
 

 
       \t if($("#table").length > -1){ 
 

 
     // toastr.options.timeOut = 1500; 
 
     // toastr.success("empity"); 
 

 
     toastr.options.timeOut = 1500; 
 
     toastr.success('deleted'); 
 

 
      } 
 

 
    else if($("#table").length <= 0){ 
 

 
     \t toastr.options.timeOut = 1500; 
 
     toastr.success('empity'); 
 

 
      } 
 

 
    } 
 

 
    else 
 
    { 
 
    \t toastr.options.timeOut = 1500; 
 
     toastr.success('please select a row'); 
 
    } 
 
                  
 
    }); 
 

+0

これを確認してくださいhttps://stackoverflow.com/questions/10360450/how-場合to-check-if-a-tr-contains-a-td-with-a-specific-css-class-jquery –

答えて

0

(!tab.data()。任意の()){

  toastr.options.timeOut = 1500; 
      toastr.success('table is empty'); 

     } 


      else{ 
        tab.row('.selected').remove().draw(); 
        toastr.options.timeOut = 1500; 
        toastr.success('deleted'); 

      } 
関連する問題