logo
down
shadow

how to append data using ajax posts and datatables are not working?


how to append data using ajax posts and datatables are not working?

By : Roxane Potocki
Date : November 21 2020, 04:01 AM
I hope this helps you .
code :
for(var i=0; i<data["data"].length; i++){
      if(data["data"][i].candiateName != null){ 
          var imge = data["data"][i].Photo;
          var name = data["data"][i].candiateName;
          var bg = data["data"][i].Background;
      $("#partyBody").append("<tr>"+
          "<td id='resdata" + i + "'>" + name+"</td>"+
          "<td id='resdata1" + i + "' ><img id= 'photo" + i + "' src='http://aptsvotes.com/wp-content/themes/apts2019/img'" + imge+"></td>"+
          "<td id='resdata2" + i + "'>" + bg+"</td>"+             
          "</tr>");

        }
    }


Share : facebook icon twitter icon
SimpleModal Popup for posts not working with posts called by ajax

SimpleModal Popup for posts not working with posts called by ajax


By : Daniel RG
Date : March 29 2020, 07:55 AM
wish help you to fix your issue That's because your SimpleModal function is applied to all posts that exist on the page when the document is loaded.
The infinte scroll thing will fire ajax requests and add new posts (excerpts) on the page, after the document is loaded.
code :
$('.post').click(function(){
  // show modal
});
$('.post').on('click', function(){
  // show modal      
});
onclick event of dataTables not working after binding data using ajax

onclick event of dataTables not working after binding data using ajax


By : Monzer
Date : March 29 2020, 07:55 AM
Hope this helps You would need to use a delegated event handler. As for now you have one time binding to elements which is lost as soon the table is updated. Use
code :
$('#user-detail-datatable').on('click', 'tbody tr td a', function () {
}]
search, sort and pagination of jQuery DataTables not working with ajax data

search, sort and pagination of jQuery DataTables not working with ajax data


By : Merri
Date : March 29 2020, 07:55 AM
will help you For this issue you need to recall DataTable after successful ajax call.
code :
function sendSearchAccountDetailsRequest(orgQueryReqJSONString){

$.ajax({
        type : 'POST',
        url : ctx+'/SearchController',
        data: orgQueryReqJSONString,
        contentType: 'application/json',                                                                            
        success : function(response) {                   
        //process JSON response here                
        var counter = 0;
        var tableDataHTML = '';

        $.each(response.organizationDetailsList, function(counter){
            var $curr = response.organizationDetailsList[counter].organizationDetails;
            tableDataHTML += '<tr id="searched-row-'+counter+'" class="js-result-tbl-tbody-tr">'+
                             '<td>'+$curr.organizationID+'</td>'+
                             '<td>'+$curr.organizationName+'</td>'+
                             '<td>'+$curr.parentOpCoName+'</td>'+
                             '<td>'+$curr.registeredEmailID+'</td>'+
                             '<td>'+$curr.registeredPhoneNo+'</td>'+
                             '</tr>';               
            });

        $('#search-results-table-tbody').empty();
        $('#search-results-table-tbody').append(tableDataHTML);
        initResultDataTable();
        },
        error : function(response) {                 
        //handle errors here
        alert('Error !!!'+response);            
        }
});}
jQuery DataTables - AJAX call working but Data is not being graphed

jQuery DataTables - AJAX call working but Data is not being graphed


By : Bram
Date : March 29 2020, 07:55 AM
Hope that helps SOLUTION
jQuery DataTables needs one of the following in order to initialize the table.
code :
<table id="myTable" class="table table-striped table-bordered table-hover" data-page-length='14'>
   <thead>
      <tr>
         <th>Service Name</th>
         <th>Organization</th>
      </tr>
   </thead>
</table>
columns: [
    { title: "Service Name", data: "service_name" },
    { title: "Organization", data: "git_organization" }
]
jQuery DataTables Ajax.Data dynamically populated with checkbox checked state not working

jQuery DataTables Ajax.Data dynamically populated with checkbox checked state not working


By : user1827699
Date : March 29 2020, 07:55 AM
Any of those help I have a checkbox in my datatables table header that I'm trying to pass as a parameter for server side processing. It seems like this should be trivial, but I'm either overlooking something or I am missing something with how datatables works.
code :
"ajax": {
              "url": baseUrl + 'admin/get_users',
              "type": "POST",
              "data": function(d) {
                d.active_only = $('#active-users-chk').is(':checked') ? 1 : 0;
              }
          },
Related Posts Related Posts :
  • dropdown flexibility?
  • How "d3.translateExtent" coordinate works?
  • Get the element of an array that has an index given by a variable in JavaScript
  • Replace(), replacing a value not specified
  • javascript native equivalent to .each & .attr
  • Fabric getPointer method not working in Firefox
  • JS scripts not working for divs loaded with jQuery's .load()
  • Use xhr code error on switch/case (javascript)
  • ParseFloat return string instead of number in Javascript
  • How to add a custom script into React app component?
  • Show data while it's being sent to the backend
  • selecting a specific class with .parents()?
  • Get value of a selected option in an label with Javascript
  • How Do I get an HOC wrapped component function from enzyme instance when mounting?
  • i want to update the flashdata on every ajax call
  • Cannot find a tag with JSsoup even though the tag exists in Node JS
  • Exporting the RouterModule?
  • Remove the default checked value in radio button and replace it with the another radio button that is click
  • Switch to test for id and perform action based on class
  • JavaScript Random Number Generation: Unique 500 Integers in Space 10^6: Getting Collisions
  • Display files in directory using PHP and jQuery
  • Knockout JS: adding forms in foreach bindings
  • HTML5 Canvas positioning mouse clicking broken
  • JQuery on change fired only after second change of select box
  • Unable to limit WebRTC P2P Multi-participant Receiving Bandwidth
  • What is the RegEx to just return the last part of the URL
  • State Remains Undefined in React
  • removing content on website before a screen reader can read it with either JavaScript or CSS...?
  • on 'click' firing before click
  • Manipulation of an array sent by ajax to a php file, within a function of another file
  • How to use plunker or jsfiddle to run angular2 code
  • JavaScript lexical environments as objects
  • Iteratively position spheres with DOM pixels using three.js and React
  • React trying to access file at a wrong path
  • AES encryption in JS equivalent of C#
  • Filter an Array based off user input string and menu dropdown items
  • Constantly read local file with JS?
  • React navbar handler with theme
  • Show changes to HTML5 canvas immediately
  • Tooltip Stays Hidden In D3 Treemap
  • Backbone - What is the best way to listen to 2 models?
  • formatting an array of objects output
  • Bind input value to specific value in object
  • Animation doesnt work when onClick event occurs (react.js)
  • Consume enum from ambient TypeScript module using @babel/preset-typescript?
  • Changing order of React components only triggers re-render after second click
  • Track the total time the HTMLAudio was playing
  • Call javascript function in PHP file and load html file after?
  • Theme Development: JavaScript not working when linked from functions.php
  • Add attributes to multiple <td> in datatables
  • Progressive loading codesnip not quite understood
  • How to format default date in javascript?
  • Caesar cipher only gets first value right
  • innerText not showing after setting it straight after creating the element
  • How to use HTML template tag with jQuery?
  • Showing v-menue's selected option in another part of the application. Vuetify
  • How can I find and return my div element with rails and javascript?
  • The right way to use Ajax to Update a Single field in a specific Object
  • Hhow to create a react element and apply a javascript method to it
  • Change src of parent window iframe
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org