sUpdateUrl in makeEditable() function return Alert Box instead of Updating cell (PHP)

sUpdateUrl in makeEditable() function return Alert Box instead of Updating cell (PHP)

koulyveskoulyves Posts: 2Questions: 0Answers: 0
edited December 2011 in Plug-ins
Having issues using the php back end. I am following your example precisely but am only getting an alert box containing the value I attempted to edit. The simple

[code] sUpdateURL: function(value, settings)
{
return(value);
}[/code]
works fine (of course not actually changing the data source), but the echo $value return the right value but in an alert box without changing the cell value of course. Any idea what I'm doing wrong? here is some of my code:
[code]
$(document).ready(function () {
$('#example2').dataTable({
"bPaginate": true,
"bProcessiong":true,
"bServerSide":true,
"iDisplayLength": 10,
"bAutoWidth": false,
"sPaginationType": "four_button",
"sAjaxSource": "Assets/Data/PackJSON.txt",
"aoColumns": [{ "bVisible": false }, { "bVisible": false }, null, null, null, null, null, null, null],
"sDom": 'Rlfrtip',
}).makeEditable({
sUpdateURL: "Updates/PackUpdate.php",
"aoColumns": [null, null, null, null, {
indicator: 'Saving...',
tooltip: 'Click to select town',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
data: "{'USPS':'USPS','UPS':'UPS','TNT':'TNT','USP2':'USP2','USP3':'USP3','USP15':'USP15','USP45':'USP45','USPS12':'USPS12'}"}, {}, {}]


//add a click event to every row in the table
});
});
}

[/code]

Replies

  • fffizzzfffizzz Posts: 2Questions: 0Answers: 0
    I have the same issue. Also cant get table to update after an edit.
  • samirforsamirfor Posts: 1Questions: 0Answers: 0
    Someone managed to make it work?
  • bandofbrothersbandofbrothers Posts: 2Questions: 0Answers: 0
    I am the same, give the trick ?
  • vivekeswavivekeswa Posts: 1Questions: 0Answers: 0
    i have the same problem.In updateurl what is value, settings parameters
  • ianmclianmcl Posts: 4Questions: 0Answers: 0
    edited June 2012
    I fixed this today - check that there are no blank lines after your closing script tag e.g.
    [code]
    <?php
    ...yada yada...
    ?>


    [/code]
    ...is wrong - get rid of the training blank lines after the closing tag
  • jconradjconrad Posts: 1Questions: 0Answers: 0
    edited October 2012
    http://code.google.com/p/jquery-datatables-editable/wiki/HTMLSource

    [...] Function should return the SAME value that is posted - any other text will be shown as an error message [...].

    e.g
    post "TEST" , return "TEST"
  • samarasasamarasa Posts: 1Questions: 0Answers: 0
    edited November 2012
    I have return the same submitted value in my PHP controller calss as bellow

    echo $_REQUEST['value'];

    But i still have the alert popup showing. There is a space appended to the return value

    Fix: trim the values in jquery.dataTables.editable.js on line number 150.

    if (sNewCellValue == sValue) {

    to

    if (sNewCellValue.trim() == sValue.trim()) {
  • grubbjtgrubbjt Posts: 1Questions: 0Answers: 0
    samarasa,

    Thank you!!! I've been banging my head into the desk for hours trying to figure this out. I wondered if it was a space situation, but didn't think about editing the datatables js. Your fix did the trick.

    Thanks again
This discussion has been closed.