jQuery UI Widgets Forums Plugins Data Adapter POST variable not updating from event

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • POST variable not updating from event #81636

    telco5
    Participant

    I cannot tell if this is my lack of understanding of javascript or how the jquery/dataAdapter is accessing this var.

    I make a change to a global variable within an event but the POST variable is not being updated when it send to the back end.

    Im sure this is simple but Im sure I had this working at some point but staring at this for a couple of hours and setting up test code I am at a loss as to what I am doing wrong here.

    Thanks

    <script type=”text/javascript”>
    $(document).ready(function () {

    slaFilter = “OFF”;

    $(“#jqxCheckBoxSLA”).jqxCheckBox({ width: 120, height: 25});
    $(“#jqxCheckBoxSLA”).on(‘change’, function (event) {
    var checked = event.args.checked;
    if (checked) {
    slaFilter = “ON”;
    $(“#customersGrid”).jqxGrid(‘clear’);
    $(“#customersGrid”).jqxGrid(‘updatebounddata’, ‘cells’);

    }
    else {

    slaFilter = “OFF”;
    $(“#customersGrid”).jqxGrid(‘clear’);
    $(“#customersGrid”).jqxGrid(‘updatebounddata’, ‘cells’);

    }
    });

    sourceTable =
    {
    datatype: “json”,
    type: “POST”,
    data: {slaFilter}, <—- This is not reflecting the new value updated in event
    //async: false,
    url: “/sqlTickets/getActiveTickets”,
    datafields: [

    { name: ‘ticket_number’ },
    ]

    };
    dataAdapterTable = new $.jqx.dataAdapter(sourceTable);

    $(“#customersGrid”).jqxGrid(
    {
    code truncated ….
    }

    </script>

    POST variable not updating from event #81662

    ivailo
    Participant

    Hi telco5,

    You have to send variables to the server as key-value pairs:

    data: {
                        slaFilter:slaFilter
                    },

    Best Regards,
    Ivailo Ivanov

    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.