Results 1 to 2 of 2

Thread: Delete function with php/mysql backend problem

  1. #1

    Default Delete function with php/mysql backend problem

    Hi,
    i've encountered a problem following a tutorial http://defafe.com/tutorial-extjs-edit-and-delete-file/

    Problem: When i hit the delete button after selecting something from grid windows flips me this:
    Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience.
    Twice.

    Afterwards it stops the response and gives me an option to "LOAD RESPONSE".
    Thing is it actually deletes selected items from database but it's really inconvinient, so how could i go about and fix this?

    Del function

    Code:
        function del(btn){
            if(btn == 'yes'){
                var m = SimpleListingEditorGrid.getSelectionModel().getSelections();
                SimpleDataStore.load({params:{del:m[0].get("id"),start:0,limit:6}});
            }
        }
    Del button

    Code:
         {
                //buttton delete
                text:'Delete',
                iconCls:'delete',//create icon
                handler: function()
                {
                 var m = SimpleListingEditorGrid.getSelectionModel().getSelections();
                        if(m.length > 0){
                 Ext.MessageBox.confirm('Message', 'are you sure to delete this file?' , del);
                        }
                        else{
                            Ext.MessageBox.alert('Message', 'please... Choose one of file...!');
                        }
                    }
                
                }

    Php

    Code:
    else if(isset($_POST["del"])){
            $sql = "delete from simpleform where id ='".$_POST["del"]."'";    
            mysql_query($sql) or die(mysql_error());
            mysql_close();
        }


    And another question about the del function

    Code:
                var m = SimpleListingEditorGrid.getSelectionModel().getSelections();
                SimpleDataStore.load({params:{del:m[0].get("id"),start:0,limit:6}});
    this is for multiple selections, how would i change it if i had a singleselect grid?

  2. #2

    Default

    Any suggestions, directions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •