jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Passing a variable not working at Apache 2.2.21/PHP 5.3.8
Tagged: passing variables, php.ini
This topic contains 2 replies, has 2 voices, and was last updated by dujmovicv 12 years, 4 months ago.
-
Author
-
Hi All,
I’m working on a script that uses the JQwidgets’s grid framework. Instead of the pure .js files, I’m using .php files to generate the JS code. In some cases (when passing a variable through the $_GET command), the script does not work what it is supposed to because the variable is not passed to the other php script. It IS working on my other machine with Apache 2.2.9/PHP 5.2.6 that’s why I thought it is a server issue. I even tried to replace the php.ini file at my machine with the newer version (Apache 2.2.21) and it WORKED.
Here’s the part of the script :var source = { datatype: "json", datafields: [ { name: 'id', type: 'number' }, { name: 'task_name', type: 'string' }, { name: 'task_worked_by', type: 'string' }, { name: 'task_id', type: 'number' }, { name: 'project_id', type: 'string' }, { name: 'task_notice', type: 'string' }, { name: 'task_cost', type: 'string' }, { name: 'units_spent', type: 'number' }, { name: 'units_label', type: 'string' }, { name: 'sub_total', type: 'string' }, { name: 'finished', type: 'number' }, { name: 'timestamp', type: 'string' } ], id: 'id', url: '../grid/jqwidgets/controllers/project_details_controller.php?action=<?=$action;?>', deleterow: function (rowid, commit) { // synchronize with the server - send delete command var data = "delete=true&id=" + rowid; $.ajax({ dataType: 'json', url: '../grid/jqwidgets/controllers/project_details_controller.php?action=<?=$action;?>', data: data, success: function (data, status, xhr) { // delete command is executed. commit(true); } }); }, };
How can I change the script to pass the variable ‘action’ REGARDLESS of the server version and php.ini configuration? Is it possible at all?
Thank you in advance.Hi dujmovicv,
The jqxDataAdapter internally calls the jQuery’s Ajax function. From the provided code I can’t say what might be wrong on your side. If it is easier for you, use the jQuery’s Ajax function and inside the success callback, create a jqxDataAdapter from the data that comes from the server. After that bind the Grid to it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThank you Peter for your reply. I think I’m gonna change some methods that I thought will do the job…
-
AuthorPosts
You must be logged in to reply to this topic.