简体   繁体   中英

Using select options xeditable angularjs

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM