Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
833 B
1
Indexable
Never
drawCallback: function () {
        let api = this.api();
        let rowCount = api.rows({ page: 'current' }).count();
        if (
          !$('.trafficSourcesRight tbody tr td:first-child').hasClass(
            'dataTables_empty'
          )
        ) {
          for (
            let i = 0;
            i < api.page.len() - (rowCount === 0 ? 1 : rowCount);
            i++
          ) {
            $('.trafficSourcesRight tbody').append(
              $('
                <tr style="position: relative"><td>&nbsp;</td><td></td><td></td>
                <span class="progressBar"></span>
                </tr>')
            );
          }
        }
      },

function setProgressBar() {
    tableData.forEach(element => {
        $( ".progressBar:contains(element.countryName)" ).css( 'width', element.percentValue )
    });
}