0

I have an issue when the grid's Add functionality kicks in. My colModel defines some valid options for the select element. When faced with adding a new row to the grid, the select element is always rendering with an undefined value and not one of the actual values from the colModel. What is the technique to ensuring only the actual colModel values for this element are presented?

David Lazar
  • 10,865
  • 3
  • 25
  • 38
  • 1
    What is "the select element"? What are you trying to do exactly? – Dave L. Apr 30 '12 at 15:05
  • I have a grid row. When editing it (initiated via dblClick) the form editing fields show up. The select element has a child option element with the text "undefined". Why? – David Lazar May 03 '12 at 17:21
  • Can you post your `colModel` definition? I would guess something is wrong with the configuration of the `editoptions`. – Dave L. May 03 '12 at 18:09
  • Ok.. pretty basic stuff for a colModel definition... the options are provided as a variable and do not contain anything undefined. { name: 'vendor', index: 'vendor', width: 240, editable: true, edittype: 'select', editoptions: vendorOptions, editrules: {required: true }, sortable: true } – David Lazar May 04 '12 at 13:53
  • Yes but what is the value of `vendorOptions`? What are you setting it to? There are 3 different ways to do it as described here: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules#editable – Dave L. May 04 '12 at 14:47
  • The options are standard... `var vendorOptions = {value: "1:AAA;2:BBB;3:CCC;4:DDD;5:EEE;6:FFF;"};` – David Lazar May 04 '12 at 15:30
  • That contains a syntax mistake, see my answer below. – Dave L. May 04 '12 at 16:52

1 Answers1

1

According to the docs, you have a syntax mistake in your editoptions configuration:

Note the last element in the string - it should not end with ;

Therefore your vendorOptions value should be:

var vendorOptions = {value: "1:AAA;2:BBB;3:CCC;4:DDD;5:EEE;6:FFF"};

You can read the full docs here: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules#editable

Dave L.
  • 9,595
  • 7
  • 43
  • 69