Loading ...
Sorry, an error occurred while loading the content.
 

probllem is on deleting row

Expand Messages
  • Md. Ruzdi Islam
    // JavaScript Document function deletecategory(id,category){ if (confirm( Are you sure you want to delete category :: + category + )){
    Message 1 of 3 , Jun 26, 2009
      // JavaScript Document 
      function deletecategory(id,category){
         if (confirm("Are you sure you want to delete category :: '" + category + "'")){
             //window.location.href = 'category/delete/' + id;
       
              var row = $(this).parents('tr:first');
              $.ajax({
                      type: "POST",
      url: "category/delete",
                      data: "id="+ id,
                      success: function(){
      alert('Successfully deleted');
                              $(row).remove(); //Remove the row containing the image element
                      }
              });

              return false;
         }

      i am using this for deleting but problem is that when i perform a delete operation then item id deleted from database but in view the table row is not removing . In this code what is the problem .Here , "category items" are in a table row .

      Ruzdi
    • pranto157
      May be you can try on this.. $.ajax({ type: POST , url: category/delete/ +id, success: function(){ alert( Successfully deleted ); $(row).remove( ); //Remove
      Message 2 of 3 , Jun 27, 2009
        May be you can try on this..

        $.ajax({
        type: "POST",
        url: "category/delete/"+id,

        success: function(){
        alert('Successfully deleted');
        $(row).remove( ); //Remove the row containing the image element
        }
        });


        PHP Function in Category Controller is like as follows may be:

        function delete($id){
        $this->Category->del($id);
        exit();
        }




        --- In phpexperts@yahoogroups.com, "Md. Ruzdi Islam" <ruzdibd@...> wrote:
        >
        > // JavaScript Document
        > function deletecategory(id,category){
        > if (confirm("Are you sure you want to delete category :: '" + category +
        > "'")){
        > //window.location.href = 'category/delete/' + id;
        >
        > var row = $(this).parents('tr:first');
        > $.ajax({
        > type: "POST",
        > url: "category/delete",
        > data: "id="+ id,
        > success: function(){
        > alert('Successfully deleted');
        > $(row).remove(); //Remove the row containing the
        > image element
        > }
        > });
        >
        > return false;
        > }
        > }
        >
        > i am using this for deleting but problem is that when i perform a delete
        > operation then item id deleted from database but in view the table row is
        > not removing . In this code what is the problem .Here , "category items" are
        > in a table row .
        >
        > Ruzdi
        >
      • Md. Ruzdi Islam
        That change does same thing as previous one does. Ruzdi
        Message 3 of 3 , Jun 27, 2009
          That change does same thing as previous one does.

          Ruzdi

          On Sat, Jun 27, 2009 at 6:25 PM, pranto157 <pranto157@...> wrote:


          May be you can try on this..

          $.ajax({
          type: "POST",
          url: "category/delete/"+id,



          success: function(){
          alert('Successfully deleted');
          $(row).remove( ); //Remove the row containing the image element
          }
          });

          PHP Function in Category Controller is like as follows may be:

          function delete($id){
          $this->Category->del($id);
          exit();

          }

          --- In phpexperts@yahoogroups.com, "Md. Ruzdi Islam" <ruzdibd@...> wrote:
          >
          > // JavaScript Document
          > function deletecategory(id,category){
          > if (confirm("Are you sure you want to delete category :: '" + category +
          > "'")){
          > //window.location.href = 'category/delete/' + id;
          >
          > var row = $(this).parents('tr:first');
          > $.ajax({
          > type: "POST",
          > url: "category/delete",
          > data: "id="+ id,
          > success: function(){
          > alert('Successfully deleted');
          > $(row).remove(); //Remove the row containing the
          > image element
          > }
          > });
          >
          > return false;
          > }
          > }
          >
          > i am using this for deleting but problem is that when i perform a delete
          > operation then item id deleted from database but in view the table row is
          > not removing . In this code what is the problem .Here , "category items" are
          > in a table row .
          >
          > Ruzdi
          >


        Your message has been successfully submitted and would be delivered to recipients shortly.