Using select options xeditable angularjs

37 views Asked by At

I am trying to edit table which contains a select drop-down menu. For that, I am using xeditable for angularjs. My HTML file containt: <td><span editable-select="awsendpoint.organizationName" e-name="organizationName" e-form="rowform" e-ng-options="organization.organizationName for organization in getallorganization">{{awsendpoint.organizationName}}</span></td>

getallorganization = [{ "name":"John1", "organizationName":"ORG1", "city":"New York" },{ "name":"John2", "organizationName":"ORG2", "city":"New York" },{ "name":"John3", "organizationName":"ORG3", "city":"New York" }]

The drop-down menu is showing in table and edit mode.

The problem here is during update the data. When I am trying to update the table data. Updated "organizationName" field is showing the whole organization object and the data is not getting updated.

1

There are 1 answers

0
AnthW On

If you would like the value to be one property from your getallorganization, then you need to set that in the e-ng-options.

E.g. e-ng-options="organization.organizationName as organization.name for organization in getallorganization"