This is a migrated thread and some comments may be shown as answers.

Combo box value in Popup editor

1 Answer 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Just
Top achievements
Rank 1
Just asked on 19 Aug 2012, 09:58 PM
I have a custom popup template attached to grid for edit and add. In the template I've a drop down (combo box) column. I can get it populated fine.
The problem is it always defaults to the first value. How can I get it to set to the value that was in the row being edited.

The combobox is defined like below
<input name="ProductType" data-source="myDataSource" data-text-field="productName"
                    data-value-field="productId" data-bind="value:ProductType" data-role="dropdownlist" />

The grid shows the "ProductType" column.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Just
Top achievements
Rank 1
answered on 20 Aug 2012, 01:14 PM
I changed it to

<input name="ProductType" data-source="myDataSource" data-text-field="productName"
                    data-value-field="productName" data-bind="value:ProductType" data-role="dropdownlist" />

and it works.

But now how do I get the Product Id of the selected product?

In the grid the ProductName is a read only label.
Tags
Grid
Asked by
Just
Top achievements
Rank 1
Answers by
Just
Top achievements
Rank 1
Share this question
or