-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newbie issue - $_REQUEST don't populate #1508
Comments
My guess: the default data type for server communication has changed in w2ui 1.5 and all the examples are probably still for w2ui 1.4 Default dataType in 1.4: You can change the data type as follows. Valid values are HTTP, HTTPJSON, RESTFULL, RESTFULLJSON, JSON (case sensitive).
For more information on the differences in 1.4 / 1.5 you should visit this thread: #1351 |
Please, very please, write short bug description. Respect to other people time is appreciated :). @mpf82 response seems to be sound. Reopen the ticket if it did not help. |
I have the same issue, I always got "Command "" is not recognized." Seems to me w2grid() do not returns $_REQUEST with "get", "get-records" or something like that. Do you have any solution? |
@AlexKovynev If you're using the latest master then "get" will no longer be sent to the server for a "get" request and in addition "cmd" has been renamed to "action" for "delete"/"save" commands. That means, if the data does not contain an "action" attribute, you should handle it as "get". If you're using 1.5 RC1 then see my answer above. You could always inspect your browser's network tab in the dev console to see what exactly gets sent to your server, or just inspect all the data that your server receives. |
Thanks for reply. I noticed, than new version make a new problems. :) I've set )
) |
First of all, really thanks for W2UI! It's amazing!
I am a newbie to w2ui and I have serios problems with something really basic.
I am trying to get data from my server (LAMP) but I get always the same (Command "" is not recognized). I did everything that I know. I try for more then 15 hours and nothing.
I get data only when I assembly a array in PHP and encode to Json to pass with an ECO.
But I want to make it work with the default method to send request.
I tried to use the example that is in the folder " /server/php " and get the same issue. I try all examples that have server connection.
My $_REQUEST array do not receive data, if I send an var in the url. ...php?param=1 I get it into the users.php. But I do not receive $_REQUEST['cmd'] and the other vars.
Please some one help me. Thanks in advance.
My code:
users.php I did customization in server, user, pass...
`<?php
require("w2db.php");
require("w2lib.php");
$db = new dbConnection("mysql");
$db->connect("localhost", "xxx", "xxx", "tdr_DB", "3306");
switch ($_REQUEST['cmd']) {
}
`
in index.php is:
<script type="text/javascript" src="../../libs/jquery/jquery-2.1.4.min.js"></script> <script type="text/javascript" src="../../dist/w2ui.min.js"></script> <script> $(function () { // define and render grid $('#users').w2grid({ name : 'users', url : 'users.php', header : 'List of Users', show: { header : true, toolbar : true, footer : true, toolbarAdd : true, toolbarDelete : true }, columns: [ { field: 'fname', caption: 'First Name', size: '150px', searchable: true }, { field: 'lname', caption: 'Last Name', size: '150px', searchable: true }, { field: 'email', caption: 'Email', size: '100%', searchable: true }, { field: 'login', caption: 'Login', size: '150px', searchable: true } ], onAdd: function (event) { editUser(0); }, onDblClick: function (event) { editUser(event.recid); } });`
});
function editUser(recid) {
',$().w2popup('open', {
title : (recid == 0 ? 'Add User' : 'Edit User'),
body : '
style : 'padding: 15px 0px 0px 0px',
width : 500,
height : 300,
onOpen : function (event) {
event.onComplete = function () {
w2ui['user_edit'].clear();
w2ui['user_edit'].recid = recid;
$('#w2ui-popup #user_edit').w2render('user_edit');
}
}
});
}
</script> `
I created the table in mysql. I am able to get data with my functions..
Sorry this basic question, but I did everything that I know.
The text was updated successfully, but these errors were encountered: