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_Related Related Topics sp_TopicIcon
Dynamically Change Drop Down Item Text
20/03/2011
07:51
Avatar
drumboog
Tallahassee, FL
New Member
Members
Forum Posts: 2
Member Since:
18/01/2011
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

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