jQuery UI Widgets › Forums › General Discussions › Plugins › Data Adapter › POST variable not updating from event
This topic contains 1 reply, has 2 voices, and was last updated by ivailo 9 years, 9 months ago.
-
Author
-
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>
Hi telco5,
You have to send variables to the server as key-value pairs:
data: { slaFilter:slaFilter },Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.