jQuery UI Widgets Forums Grid Update operation not working

Tagged: , ,

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 9 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Update operation not working #72044


    I have the following code that sends data to my php file when I select the update button

            updaterow: function (rowid, rowdata, commit) {
                        var data = "update=true&" + $.param(rowdata);
                            dataType: 'json',
                            type: "POST",
                            url: 'CurHold_data.php',
                            data: data,
                            success: function (data, status, xhr) {
                                // update command is executed.
                    }//updaterow ends
                };//var source ends

    console.log() logs the modified data correctly.

    My php file is as follows:

            if (isset($_POST['update']))
               	// UPDATE COMMAND 
             	$update_query = "UPDATE 'rep_cur_holdings' SET                                       'Description'='".$_POST['Description']."',
    	'Portfolio'='".$_POST['Portfolio']."' WHERE 'CUSIP'='".$_POST['CUSIP']."'";
    	$result=mysql_query($update_query) or die("SQL  Error 1: " . mysql_error());
                    SELECT STATEMENT Code Goes here

    But as soon as I click the save button the data is reset in the grid and there is no change in the database.

              $("#Save").click(function () {
                    if (editrow >= 0) {
                        var row = { Description: $("#Description").val(), CUSIP: $("#CUSIP").val(), OrigFace: $("#OrigFace").val(),Factor: $("#Factor").val(), CurrentFace: $("#CurrentFace").val(), Mark: $("#Mark").val(),MarketVal: $("#MarketVal").val(), Sector: $("#Sector").val(), SubSector: $("#SubSector").val(),Strategy: $("#Strategy").val(), Portfolio: $("#Portfolio").val()};
                        $('#jqxgrid').jqxGrid('updaterow', editrow, row);
    Update operation not working #72060

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.