Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
igGrid Combox Box Column losing value
posted

I am losing the selected value of my combo box column in my IGNITE UI Grid when the row enters Edit mode.

All of the data loads correctly initially, but when I double click on my row, the combo box column is cleared out.

I am setting up this column via the code below:

...

column.For(x => x.Size).HeaderText("Size").Width("10%").FormatterFunction("lookupBarSize");

...

cs.ColumnSetting().ColumnKey("Size").Required(true).EditorType(ColumnEditorType.Combo).ComboEditorOptions(co => co.RenderMatchItemsCondition(ComboRenderMatchItemsCondition.StartsWith).FilteringType(ComboFilteringType.Local).AutoComplete(true).DataSource(ViewBag.BarSizes).ValueKey("BarSzKey").TextKey("BarSzDesc"));

Here is my formatter function:

var sizeList = @Html.Raw(Json.Encode(ViewBag.BarSizes))

function lookupBarSize(val) {
var i, size;

for (i = 0; i < sizeList.length; i++) {
size = sizeList[i];
if (size.BarSzKey == $.trim(val)) {
val = size.BarSzDesc;
}
}

return val;
}

The ViewBag data is set in my Index Action in the Controller