EasyUI Forum
May 17, 2024, 07:50:50 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Server Response from destroyUrl / updateUrl  (Read 4785 times)
sreekuttan
Newbie
*
Posts: 2


View Profile
« on: May 27, 2014, 09:28:43 PM »

Consider the following sample code
Code:
$('#tt').edatagrid({
    url: 'datagrid_data.json',
    saveUrl: 'savedetails.php',
    updateUrl: 'upddetails.php',
    destroyUrl: 'delrow.php'
});

and server side
Code:
//savedetails.php
<?php
extract
($_GET);
extract($_POST);
$query "insert into tab values ('$a1','$a2','$a3')";
mysql_query($query);
echo 
"Row inserted";
?>






How I can get the response of
Code:
"Row inserted"
at the front end code on addition of a new row?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 28, 2014, 08:21:53 AM »

Your 'savedetails.php' must return the saved row. When a new row saved successfully, the 'onSave' event fires, in which you will know what row has been saved.
Code:
$('#tt').edatagrid({
    url: 'datagrid_data.json',
    saveUrl: 'savedetails.php',
    updateUrl: 'upddetails.php',
    destroyUrl: 'delrow.php',
    onSave: function(index,row){...}
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!