Forum
19:39
20/08/2011
hi all,
I just upgraded to jqGRID 4.4.4, jquery 1.9.0.and jqueryUI 1.10.0.
However, now I'm gettting a syntax error from jquery 1.9.0 when i open a edit form with select box fields. The typical error message I'm getting from Firebug is as follows:
Syntax error, unrecognized expression: <select><option value="0″>Not Assigned</option><option value="2″>MI01</option></select>
When i revert back to jquery 1.8.3, the jqGRID edit form select boxes display and work correctly. It appears that jquery 1.9.0 is no longer accepting the previously recommended jqGRID dataUrl select format when the edit form loads.
Non jqGRID constructed select boxes continue to function correctly.
I discovered the error is being detected in the jquery 1.9.0 library tokenize function.
Is this a jquery or jqgrid error?
thanks.
22:11
Moderators
30/10/2007
Hello,
As I say every time, PLEASE GIVE US A TEST CASE - only this way we can help.
You can use a pastebin.com for this purpose, but any other link will help too.
Thank you for the understanding.
Kind Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
08:11
20/08/2011
ok,
I have a small simple test site that dumps US State data in the displayed grid. Click on this site to see the error.
0. Click on http://www.nados.com/jqgrid-test to see test site.
1. Click on the Add button with firebug enabled to see jqGrid add form select box error.
2. Switch jquery between v1.10.0 and v1.8.3 jquery libraries in index.php file.
3. jQuery v1.8.3 does not trigger error. The add form select box works and shows state names.
4. Click on site link containing zip file to get site files.
If you can't get the files, let me know.
thanks.
09:25
Moderators
30/10/2007
Hello,
Thank you very much. As you can see when doing this way we can work quick and better.
Please check what your script from state-se-script.php return.
The script return several empty lines r n which causes jquery to do so.
(The error comes from jQuery)
If you trim these before to send them to the grid all will be OK.
You should answer why.
If you do not know, you can not include the migration module (jquery-migrate-1.0.0.js)
if you use jqGrid version 4.4.4
Kind Regards
Tony
P.S. Instead I will try to fix the code in grid (trim it) , before to use it in the grid.
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:08
10/08/2009
I think the problem is that jQuery 1.9.0 don't accept as input strings which starts with CRLF ("\\r\\n"). The select which returns the server looks as
If you would remove the first "\\r\\n\\r\\n" the problem will be solved.
From my point of view it's very interesting information, but it's mostly the compatibility bug in jQuery and not the problem in jqGrid.
Best regards
Oleg
P.S. A stupid editor has the forum! One have to write always the backslash twice to make it displayed correctly.
17:53
20/08/2011
Tony,
As you can see when doing this way we can work quick and better.
I have no problem providing you with whatever you need, I just didn't know what you needed at first.
P.S. What's the problem with using the "jquery-migrate-1.0.0″ migration module with jqGrid 4.4.4?
Tony & Oleg,
Thanks for finding the problem.
I did not see that "\\r\\n\\r\\n" was causing the issue. Appearently, the jQuery 1.8.3 is trimming this out where 1.9.0 is not?
In any case, i don't see how "\\r\\n\\r\\n" is being added to the $output variable used by echo in the "state-se-script.php" script. I'm not manually inserting any "\\r\\n\\r\\n" into $output and as far as i know, echo does not add "\\r\\n\\r\\n" to the string. Surrounding the echo variable $output with php trim() in the script does not help.
Are you saying that the "\\r\\n\\r\\n" is being added to the script output string from the server by jquery?
19:06
Moderators
30/10/2007
Hello,
The \r \n things are builded server side, so you will need to look carfuly in your PHP code.
The jqGrid 4.4.4 does not need this migration since it supports fully jQuery 1.9.
The migration is needed for the old plugins which does not support jQuery 1.9, but want to use it
You can look here
and in ths jQuery blog
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
20:11
20/08/2011
Tony,
The rn things are builded server side, so you will need to look carfuly in your PHP code.
I reduced the php script executed by dataUrl to:
echo trim('<select><option value="0">item0</option><option value="1">item1</option></select>');
?>
and added a jquery $.post to run the script and append the received select string to a div at the end of the test site.
The rn is still being inserted, the resulting select box works and jquery shows no errors!
The error still occures only in jqGrid editoptions dataUrl.
I traced the problem area in the v4.4.4 jqGrid source library to line 5857. It blows up on the "a = $(data).html();" statement. I added the statement "data = $.trim(data);" before the isFunction test. It now works.
So… to be clear, the problem is the use of $(data).html(); in gqGrid, not gqGrid it's self. I added $(data).html(); to the jquery $.post statement in the html body of my test site and jquery threw the same error.
18:07
Moderators
30/10/2007
Hello,
It seems to me that there is something not good in your php server.
By example I have the update the online demo to use jQuery 1.9 and jQuery UI 1.9 and there is no problem
with dataUrl used in similar example.
Please check in demo
New in version 3.5 => Form improvemets
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
19:24
20/08/2011
Tony,
Ok… I'll look into it. But it is still interesting that everything works well with the jquery 1.8.3 library. If i understand your use of the jquery .html() method in your jqGrid library, you are using it to filter out everything but valid html from the data string. The html() method appears to working by removing \\r\\n from the data string using jquery 1.8.3 but not 1.9.0.
In any case, if there is somthing wrong with my php server and it's adding adding \\r\\n to the output, then uploading and running the test site with jquery 1.9.0 on the client's hosting service – using their php server – should prove your point.
I'll let you know.
Thanks for all your support.
Most Users Ever Online: 715
Currently Online:
27 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66