Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pokmas_id;
- var table;
- function reload_table() {
- table.ajax.reload(null,false); //reload datatable ajax
- }
- function getIDPokmas() {
- $.ajax({
- url : "<?php echo site_url('operator/pokmas/get_id_pokmas/'.$this->uri->segment(4).'/'.$this->uri->segment(5).'/'.$this->uri->segment(6))?>",
- type: "GET",
- dataType: "JSON",
- success: function(data) {
- if (data === null) {
- pokmas_id = '';
- } else {
- pokmas_id = data.pokmas_id;
- }
- return pokmas_id;
- },
- error: function (jqXHR, textStatus, errorThrown) {
- alert('Error get data from ajax');
- }
- });
- }
- $(document).ready(function() {
- var id_pokmas = getIDPokmas();
- console.log(id_pokmas);
- table = $('#tableData').DataTable({
- "paging": false, // HIlangkan Pagination
- "searching": false, // Hilangkan Search
- "responsive": true,
- "processing": false,
- "serverSide": true,
- "order": [ 1, 'asc'],
- "ajax": {
- "url": "<?php echo site_url('operator/pokmas/data_list_pokmas')?>"+"/"+id_pokmas,
- "type": "POST"
- },
- "columnDefs": [
- {
- "targets": [ 0 ],
- "orderable": false,
- },
- ],
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement