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
shows 'undefined' in grid when edittype=select
19/10/2009
23:59
Avatar
sand123
Member
Members
Forum Posts: 9
Member Since:
20/10/2009
sp_UserOfflineSmall Offline

when in colModel edittype set to 'select' and dataUrl points to external php script, in grid it shows all cells as 'undefined', but when I try to Add or Edit – it fills dropdown correctly in the form. When I just link to 3.5.2 version – it works, but when I use 3.5.3 – it does'nt. And response JSON arrays from external script (dataUrl) filled also correctly in both versions. Any idea?

20/10/2009
02:55
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Your post  does not help. We need a test case, link to the problem or the code with the data.

Reagrds

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.

20/10/2009
04:09
Avatar
sand123
Member
Members
Forum Posts: 9
Member Since:
20/10/2009
sp_UserOfflineSmall Offline

colModel section (dataType in jqGrid.options set to JSON)

{

name:'id_tag',

index:'id_tag',

edittype:'select',

editoptions:{

dataUrl:'./lib/php/do.list.php?table=bak_tags'

},
formatter:'select'

}

raw GET response when open form for adding or editing

<select>
<option value='1'>Acronis</option>
<option value='2'>APbackup</option>

</select>

load data response. In grid, in column for 'id_tag' must be 'Acronis', but there 'undefined'. All other columns showed correctly

{

“page”:”1″,

“total”:1,

“records”:”1″,

“rows”:[
{
"id":"1",
"cell":["1","Acronis","MyServerName"]
}

]

}

21/10/2009
02:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

All work as expected. Just to analize the situation:

1. You set a edit type select - in this case we expect the data for the select to be get when we perform editiing via the dataUrl option.

2. In the same way you use the formatter select. These values should be in the grid options before you populate the data to the grid. The simple question is why? Just to think - in the case provided from you use another request to obtain the data - in the same time the grid uses his own request to populate the data, which request will be done first? - it is unknown. I think you understand this point. In order to work this you should

...

{ name: 'some',  edittype:'select', formatter:'select', editoptions : {dataUrl:'the_url', value:{"1:one;2:two..."} }

The editoption value is for the formatter select while the dataUrl is for the editing.

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.

21/10/2009
06:00
Avatar
sand123
Member
Members
Forum Posts: 9
Member Since:
20/10/2009
sp_UserOfflineSmall Offline

Thanks for answer – now it works! But I was confused – if there was error in colModel definition – why it works with 3.5.2 – while *ALL* other project files (html,js,php,mySQL db) are the same? And the second one: it's not comfortable (IMHO) to use param 'value' explicitly defined in colModel if I use external URL for dropdown values. May it be optionally allowed preloading these values when init grid: i.e, ajaxSetup: async->false, load data according to editUr(if 'value' parameter is not defined) and fill 'value' parameter, ajaxSetup: async->true, continue init grid

21/10/2009
06:45
Avatar
sand123
Member
Members
Forum Posts: 9
Member Since:
20/10/2009
sp_UserOfflineSmall Offline

And one more important thing (be patient, plz): edyttype=select works fine, BUT

  • reload page
  • select any row in grid and click [Edit] - edit form popup
  • fields with edittype=select filled with values but they don't match values in this record - they always select 1st item in listbox
  • close form and open again - on the same record - values selected correctly.

this situation reproduced all the time. in editOptions recreateForm = false

21/10/2009
06:57
Avatar
sand123
Member
Members
Forum Posts: 9
Member Since:
20/10/2009
sp_UserOfflineSmall Offline

version=3.5.3; if (before edit) open Add form and close (whatever save or not new record) - than also all forms next time filled correctly

21/10/2009
09:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

The bug is fixed in 3.6beta.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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