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
select and editoptions
02/11/2009
17:45
Avatar
Andrew
Guest
Guests

Hi,

I am trying to use the edittype:”select”, formatter:”select” and editoptions:{values:'1:Type1;2:Type2'} in my colModel

colModel : [  

         {name:'pk', index:'pk', width:20, sortable:true, 

          jsonmap:'pk',  sorttype:'integer'}, 

         {name:'id', index:'id', align:'left', jsonmap:'fields.id',

          sortable:true, editable:true, edittype:'select', formatter:'select',

          editoptions:{values:'1:value1;2:value2;3:value3'},

         {name:'type', index:'type', width:100,align:'center',

          jsonmap:'fields.type',  sortable:true,editable:true}

]

but the value for id returned in the json object is not a string (it doesn't have quotes around it). If I remove the edittype and editoptions the id value appears in the column of the grid but when I include the edittype, formatter and editoptions in the colMode definition I get the javascript error
(E||"").replace is not a function

The json object that fails looks like

{ "pk": 120

  "model": "myModel"

  "fields": {

       "id": 1,

       "type": "aType"

   }

}


The id value has no quotes.

I am using the edittype, formatter and editoptions in other grids but the value I am macthing against is a character (in the json object it is surrounded by quotes) and it works perfectly.

I am only guessing that the problem is with the unquoted number but I am not sure. Has anyone seen this before?

Regards

Andrew

03/11/2009
23:58
Avatar
Andrew
Guest
Guests

Ok,

I found that the problm is on line 1067 of the jquery1.3.2 file. It is the trim function and the code looks like this: 

    trim:function(E) { 
      return (E||””).replace(/^\\s+|\\s+$/g, “”)
    }

I changed it to this: 

    trim:function(E) { 
      return (E.toString()||””).replace(/^\\s+|\\s+$/g, “”)
    }

and now it works. 

Can anyone tell me if this is a bug or is there something else I can do to overide ths function without changing the jquery file.

EDIT:

I have decided that this is a bug and I have worked around it by placing the following in the <head> section of any page that shows this error (after the jQuery entry of course):

    $.extend({

        trim:function(E) { 
          return (E.toString()||””).replace(/^\\s+|\\s+$/g, “”)
        }

    });

Now it works like a charm.

Thanks
Andrew

04/11/2009
04:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for this.

This is not a bug in jQuery. It is a bug in jqGrid. I suppose you use 3.5.3 release where the bug is present.

The bug is fixed in the upcomming 3.6 release.

Best Regards

Tony

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.

04/11/2009
15:28
Avatar
Andrew
Guest
Guests

Hi Tony,

I am using jqGrid 3.5.2.

Regards

Andrew

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
51 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