Problem with editing Row
Problem with editing Row
clarke
Posts: 1Questions: 0Answers: 0
Hi Guys,
I've got some problems updating my database after submitting a new value.
The values can be edit, but they are not being stored.
this is my code.
[code]
var asInitVals = new Array();
$(document).ready(function() {
var oTable = $('#csv_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "include/csv_processing.php",
"sDom": '<"top"iflp<"clear">>rt',
"bStateSave": true,
"sPaginationType": "full_numbers",
}).makeEditable({
sUpdateURL: function(value, settings)
{
//Simulation of server-side response using a callback function
return(value);
},
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
},
"aoColumns": [
{
indicator: 'Saving platforms...',
tooltip: 'Edit Artikelnummer',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit naam',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit EOL',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit voorraad',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Merk',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Advies prijs',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Speciale prijs',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Inkoop Prijs',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
}
]
});
$("tfoot input").keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, $("tfoot input").index(this) );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("tfoot input").each( function (i) {
asInitVals[i] = this.value;
} );
$("tfoot input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("tfoot input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
} );
} );
[/code]
My php part:
[code]
//UpdateData.php
$id = $_REQUEST['id'] ;
$value = $_REQUEST['value'] ;
$column = $_REQUEST['columnName'] ;
$columnPosition = $_REQUEST['columnPosition'] ;
$columnId = $_REQUEST['columnId'] ;
$rowId = $_REQUEST['rowId'] ;
/* Update a record using information about id, columnName (property
of the object or column in the table) and value that should be
set */
echo $value;
include("connection.php");
$query="UPDATE product SET $column='$value' WHERE id='$id' ";
echo mysql_query($query);
[/code]
What am i doing wrong?
I was wondering if anyone could help me out with this one.
Thanks in advance!
I've got some problems updating my database after submitting a new value.
The values can be edit, but they are not being stored.
this is my code.
[code]
var asInitVals = new Array();
$(document).ready(function() {
var oTable = $('#csv_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "include/csv_processing.php",
"sDom": '<"top"iflp<"clear">>rt',
"bStateSave": true,
"sPaginationType": "full_numbers",
}).makeEditable({
sUpdateURL: function(value, settings)
{
//Simulation of server-side response using a callback function
return(value);
},
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
},
"aoColumns": [
{
indicator: 'Saving platforms...',
tooltip: 'Edit Artikelnummer',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit naam',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit EOL',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit voorraad',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Merk',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Advies prijs',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Speciale prijs',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
},
{
indicator: 'Saving platforms...',
tooltip: 'Edit Inkoop Prijs',
type: 'textarea',
cssclass: 'required',
submit:'Save changes'
}
]
});
$("tfoot input").keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, $("tfoot input").index(this) );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("tfoot input").each( function (i) {
asInitVals[i] = this.value;
} );
$("tfoot input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("tfoot input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
} );
} );
[/code]
My php part:
[code]
//UpdateData.php
$id = $_REQUEST['id'] ;
$value = $_REQUEST['value'] ;
$column = $_REQUEST['columnName'] ;
$columnPosition = $_REQUEST['columnPosition'] ;
$columnId = $_REQUEST['columnId'] ;
$rowId = $_REQUEST['rowId'] ;
/* Update a record using information about id, columnName (property
of the object or column in the table) and value that should be
set */
echo $value;
include("connection.php");
$query="UPDATE product SET $column='$value' WHERE id='$id' ";
echo mysql_query($query);
[/code]
What am i doing wrong?
I was wondering if anyone could help me out with this one.
Thanks in advance!
This discussion has been closed.