jQWidgets Forums

jQuery UI Widgets Forums Grid addrow not sending proper data to php engine

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years ago.

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

  • claudegel
    Participant

    Hi, I<ve a grid where I add new row where I enter data via a popup window, jqxwindow, via an edit button on each row of the grid. data is sent to a php engine to populate a mysql table.
    When a add a new row the data sent to php contain a final paraneters thatprevent my php engine to perform the operation I want
    My code is like this for the addrow:
    button that add the row

    $('#addrowbutton').click(function () {
           		 // add a new row
                    var datarow = generaterow();
                    var row_id = $("#jqxgrid").jqxGrid('getrowid', 0);
                    $("#jqxgrid").jqxGrid('addrow', row_id, datarow);
            	});
    

    $(“#jqxWidget”).on(‘select’, function (event)
    {
    // get client’s ID.
    var nocli = event.args.item.value;
    // dataadapter
    var source2 =
    {
    datatype: “json”,
    type: “POST”,
    datafields: [
    { name: ‘nocli’ },
    { name: ‘date’ },
    { name: ‘row’ },
    { name: ‘no_facture’ },
    { name: ‘code_prod’ },
    { name: ‘qtt’ },
    { name: ‘descrip’ },
    { name: ‘no_lot’ },
    { name: ‘no_retour’}
    ],
    url: url,
    async: false,
    addrow: function (rowid, rowdata, position, commit) {
    var data = “insert=true&dbase=retour_client&” + $.param(rowdata);
    // send data
    $.ajax({
    dataType: ‘json’,
    url: ‘../engine/index.php’,
    data: data,
    cache: false,
    success: function (data, status, xhr) {
    // insert command is executed.
    commit(true);
    },
    error: function (jqXHR, textStatus, errorThrown) {
    // cancel changes.
    commit(false);
    }
    });
    alert($.param(rowdata));
    },
    `
    when I check the data sent the last parameter is like this:
    …..&_=1425005912166

    what is that _=1425005912166, rowID ?
    How can I remove it or use it as my sql query do not work with such parameter. Can I replace the ‘_’ by another parameter name ?


    Peter Stoev
    Keymaster

    Hi claudegel,

    That last parameter is your jQuery Ajax function call’s no-cache which you have set: cache: false. The rowid as far as I see is not sent because you send the “rowdata”, but not the rowid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.