Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TableCloth inside AJAX Success Call #16

Open
pvegetah opened this issue Feb 22, 2016 · 0 comments
Open

TableCloth inside AJAX Success Call #16

pvegetah opened this issue Feb 22, 2016 · 0 comments

Comments

@pvegetah
Copy link

Hello Sir,

I just wanna ask I have a table inside my ajax success call just like this below.

`$('#btn-inquire-transmittal-number').click(function(e){
e.preventDefault();
$('#window-transmittal-inquiry').hide(1000);
var inputtextval = $('#transmittal_number_inquiry').val();

        $("#modalTransmittalInquiry").modal('show');
        $.ajax({
              url: "getTransmittalNum.php",
              type: "POST",
              data: {'transmittal_number_inquiry' : inputtextval},
              datatype: 'json',
              success: function(data){
                  $('#modalTransmittalInquiry').modal('show');  
                  $('#modal-content-result').html('<table class="table table-condensed tablehead table-sortable" id="table_inquiry" style="width:99%;">' +
                                                    '<tr>' +
                                                        '<thead>' +
                                                            '<th style="text-wrap:normal">Transmittal #</th>' +
                                                            '<th>Transmittal Date</th>' +
                                                            '<th>Sender Name</th>' +
                                                            '<th>Department</th>' +
                                                            '<th>Invoice #</th>' +
                                                            '<th>Amount</th>' +
                                                            '<th>Document Type</th>' +
                                                            '<th>Vendor Name</th>' +
                                                            '<th>Remark</th>' +
                                                            '<th>Action</th>' +
                                                        '</thead>' +
                                                    '<tr>' +
                                                  '</table>');


                        var trHTML = '<tr>' + 
                                    '<tbody>' +
                                        '<td><h6>' + data.transid + '</h6></td>' +
                                        '<td><h6>' + data.transdate + '</h6></td>' +
                                        '<td><h6>' + data.sender_name + '</h6></td>' +
                                        '<td><h6>' + data.department + '</h6></td>' +
                                        '<td><h6>' + data.document_number + '</h6></td>' +
                                        '<td><h6>' + data.total_amount + '</h6></td>' +
                                        '<td><h6>' + data.document_type + ' - ' + data.document_description + '</h6></td>' +
                                        '<td><h6>' + data.vendor_name + '</h6></td>' +
                                        '<td><h6>' + data.remarks + '</h6></td>' +
                                        '<td><h6>' +
                                            '<a href="acknowledge_process.php?id=$id"><button type="button" class="btn btn-success"><i class="fa fa-check-circle fa-fw"></i></button></a>' +
                                            '<a href="incomplete_process.php?id=$id"><button type="button" class="btn btn-danger" ><i class="incomplete fa fa-times-circle fa-fw"></i></button></a>' +
                                            '<a href="onprocess_process.php?id=$id"><button type="button" class="btn btn-warning" ><i class="onprocess fa fa-cogs fa-fw"></i></button></a>' +
                                        '</h6></td>' +
                                    '</tbody>' +
                                  '</tr>';

                        $('#table_inquiry').append(trHTML);

              },
              error:function(){
                  alert('Error occured..');
              }   
        }); 
    });`

I want to use the jquery plugin I have a problem where I put the code that will call my table id. Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant