I am trying to change custom post type lists table in admin pannel.I used following code code by clicking on button from front end .All code in functions.php for front end and backend.

html Button:

     <input type="button" name="return" value="Return" class="return" onclick="return_policy('<?php echo $pId; ?>');" />

javascript function return policy:

  <script type="text/javascript">
    function return_policy(id)
    {
           var postid = id;
         if (confirm("Purchase Return To Store ( Purchase Order Comission Non Refundable) ( Return Processing Fee $20)"))
           {
                      var ajaxurl = "<?php echo admin_url('custom-ajax.php')?>";
                      jQuery.ajax
                      ({
                          url:ajaxurl,
                          type:'post',
                         // dataType: 'json',
                          data: {action:'returnpolicy',postid:postid},
                       }).success(function(response)
                       {   
                          do_something_here(response);
                       });
           }
          else
          {
            alert("notok");
          }
    }

     <script>
      function do_something_here(response)
      {
            alert("ff"+response);

            alert("vvff");
             row = $('<h1>pawan</h1>'); //create row
            alert(row);
             $('#post-6038').css('background-color', '#ea2424');
                $('#post-6038').append(row);

      }
       </script>

Everything is working ,get response properly but jquery css not working on tr id because admin panel posts list table tr id is not exist on front end .

Anyone can help me please how can i edit back end row color by hit on ajax response.

Read more here: How to edit wp list table tr by clicking on button from frontend


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: