vitareinforce

cara filter di depan frontend

Jan 23rd, 2021
1,122
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('#tabterlambat').click(function () {
  2.         let data = $tabel_harian.bootstrapTable('getData');
  3.         let id_filtered = [];
  4.         for(let t = 0; t < data.length; t++) {
  5.             if(data[t].presensis.length > 0) {
  6.                 for(let p = 0; p < data[t].presensis.length; p++) {
  7.                     if(data[t].presensis[p].slotjam != null) {
  8.                         if(!data[t].presensis[p].slotjam.includes('Terlambat') && moment(data[t].presensis[p].tanggal_dan_waktu_tap).format('YYYY-MM-DD') == tanggal) {
  9.                             id_filtered.push(data[t].id);
  10.                         }
  11.                     }
  12.  
  13.                 }
  14.             }
  15.         }
  16.         $tabel_harian.bootstrapTable('filterBy', {
  17.             id: id_filtered
  18.         });
  19.     });
RAW Paste Data