Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Upgraded to jqgrid 4.4.4 and jquery 1.9.0., now getting unrecognized expression syntax error on edit form select boxes.
31/01/2013
19:39
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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.

31/01/2013
22:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

01/02/2013
08:11
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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.

01/02/2013
09:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

01/02/2013
11:08
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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

\\r\\n\\r\\n<select><option value="0">Not Assigned</option><option value="1">AL</option><option value="2">AK</option><option value="4">AZ</option><option value="5">AR</option><option value="6">CA</option><option value="8">CO</option><option value="9">CT</option><option value="10">DE</option><option value="11">DC</option><option value="12">FL</option><option value="13">GA</option><option value="15">HI</option><option value="16">ID</option><option value="17">IL</option><option value="18">IN</option><option value="19">IA</option><option value="20">KS</option><option value="21">KY</option><option value="22">LA</option><option value="23">ME</option><option value="24">MD</option><option value="25">MA</option><option value="26">MI</option><option value="27">MN</option><option value="28">MS</option><option value="29">MO</option><option value="30">MT</option><option value="31">NE</option><option value="32">NV</option><option value="33">NH</option><option value="34">NJ</option><option value="35">NM</option><option value="36">NY</option><option value="37">NC</option><option value="38">ND</option><option value="39">OH</option><option value="40">OK</option><option value="41">OR</option><option value="42">PA</option><option value="44">RI</option><option value="45">SC</option><option value="46">SD</option><option value="47">TN</option><option value="48">TX</option><option value="49">UT</option><option value="50">VT</option><option value="51">VA</option><option value="53">WA</option><option value="54">WV</option><option value="55">WI</option><option value="56">WY</option><option value="60">AS</option><option value="66">GU</option><option value="69">MP</option><option value="72">PR</option><option value="74">UM</option><option value="78">VI</option></select>

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.

01/02/2013
17:53
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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?

01/02/2013
19:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

01/02/2013
20:11
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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:

<?php
    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.

$.post('php/script.php', function(data){$(data).html(); $('div#main').append(data);});

02/02/2013
18:07
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

02/02/2013
19:24
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information