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
formatter select problem
12/12/2009
21:46
Avatar
csitol
NC
Member
Members
Forum Posts: 13
Member Since:
02/08/2009
sp_UserOfflineSmall Offline

Tony,

I'm having a problem with the formatter: 'select' and the GridToForm method (I'm using a custom form for editing).  If I include the formatter: 'select' in the colModel for the row the data displays properly in the column, however, when I attempt to edit the row the correct selection does not show up in the form.  If I remove the formatter:'select' option from the colModel, the data shows up as numbers in the grid (the actual values) but the form works perfectly.

Using ver 3.6.2

colModel code:  {name:'dc_display_type', index:'dc_display_type', id:124, hidden:false, width: 89, align: 'left', label: 'Disp Type', formatter:'select', stype:'select', editoptions:{value:'0:Text; 1:TextArea; 2:Numeric; 3:Date; 4:Time; 5:Timestamp; 6:SelectText; 7:SelectSQL; 8:SelectTable'}, editable:true},

html form code: <select id=”dc_display_type” name=”dc_display_type” class=”enter”><option value='0'>Text</option><option value='1'>TextArea</option><option value='2'>Numeric</option><option value='3'>Date</option><option value='4'>Time</option><option value='5'>Timestamp</option><option value='6'>SelectText</option><option value='7'>SelectSQL</option><option value='8'>SelectTable</option></select>

Thank you for your help!

PhilM

Further:  I did find a work-around (but I don't believe it should be necessary from the docs):

colModel code: {name:'dc_display_type', index:'dc_display_type', id:124, hidden:false, width: 89, align: 'left', label: 'Disp Type',
       formatter: formatTest, edittype:'select', stype:'select',
       editoptions:{"value":{'0':'Text', '1':'TextArea', '2':'Numeric','6':'SelectText'}}, editable:true},

formatTest function: function formatTest(cellvalue, options, rowObject) {
    return options.colModel.editoptions.value[cellvalue];
}

This works exactly as I had hoped.  Is this the way it's supposed to be done?

Thanks!

13/12/2009
18:17
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks. Will check this.

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.

26/02/2010
18:14
Avatar
csitol
NC
Member
Members
Forum Posts: 13
Member Since:
02/08/2009
sp_UserOfflineSmall Offline

Tony,

I'm not sure how far you got on this and I don't remember seeing anything in the new updates, however, this appears to have been a problem in jQuery not in jqGrid.  I'm now running jQuery 1.4.2 and still running 3.6.2 and now it's just the reverse.  If I use my own selFormat it doesn't work, if I use 'select' it does!  Go figure.

The long and short is that it doesn't appear to have been your problem.  I've been in communication with the jQuery folks and it appears that there are several major changes internally.  Perhaps this was one of them?

Hope all is well.

Phil

01/03/2010
20:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for sharing this information.

Instead I have fixed some issues regarding selects. They are in GitHub, if you have interest you can test it.

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.

01/03/2010
20:59
Avatar
csitol
NC
Member
Members
Forum Posts: 13
Member Since:
02/08/2009
sp_UserOfflineSmall Offline

Tony,

Will do.  Thanks!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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