Forum



07:51

18/01/2011

Hi,
I have a grid (form edit) with a select column. The formatter of the column is set to 'select' and the column displays correctly when initially loaded...
jQuery(document).ready( function () { var selectOptions = '1:Test 1;2:Test 2;3:Test 3'; $('#grid').jqGrid( { loadui: 'disable', height: '100%', colNames: ['', 'ID', 'Test'], colModel: [ { name: 'EditLink', index: 'EditLink', formatter: editLinkFormatter, width: 50 }, { name: 'ID', index: 'ID', key: true, editable: true, width: 50, edittype: 'select', formatter: 'select', editoptions: { value: selectOptions } }, { name: 'Test', index: 'Test', editable: true, width: 300 }, ], }); $('#grid').addRowData(1, { ID: 1, Test: 'Test Value' }); $('#grid').addRowData(2, { ID: 2, Test: 'Test Value' }); $('#grid').addRowData(3, { ID: 3, Test: 'Test Value' }); } );
I need to dynamically update the text for the dropdown list...
var selectOptions = '1:Test Change 1;2:Test Change 2;3:Test Change 3'; $('#grid').setColProp('ID', { editoptions: { value: selectOptions} });
The ids for the select list will stay the same, but the text needs to be updated. If I remove the formatter from the column, the drop down list is updated on the edit form as expected.
However, when the formatter is set to 'select', the text in the ID column is not updated and the selected values are not persisted when the edit form is opened.
Is there something in the 'select' formatter that causes problems with this?
I've tried calling $('#grid').trigger('reloadGrid') to force the grid to update, but this does not have any affect.
Is there a way to force this column to refresh and reload the editoptions?
Thanks,
Glen
Most Users Ever Online: 715
Currently Online:
78 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