我想从用户输入中获取数据并将该数据插入到表或列表中。当用户单击插入按钮时,数据将被插入到表中。如果用户单击删除按钮,选定的行将被删除。
这是我的home.view.xml
:
<Button text="insert" type="Unstyled" press="insContent"></Button>
<Button text="delete" type="Unstyled" press="deleteContent"></Button>
<l:Grid defaultSpan="L12 M12 S12" width="auto">
<l:content>
<f:SimpleForm columnsL="1" columnsM="1" editable="false" emptySpanL="4" emptySpanM="4" id="SimpleForm" labelSpanL="3" labelSpanM="3" layout="ResponsiveGridLayout" maxContainerCols="2" minWidth="1024">
<f:content>
<Label text="Name" id="lname"></Label>
<Input value="" id="iname"></Input>
<Label text="surname" id="lsurname"></Label>
<Input value="" id="isurname"></Input>
</f:content>
</f:SimpleForm>
</l:content>
</l:Grid>
<Table class="nwEpmRefappsShopControlLayout" growing="true" growingScrollToLoad="true" id="catalogTable">
<columns>
<Column demandPopin="true" id="descriptionColumn"></Column>
<Column demandPopin="true" id="descriptionColumn2"></Column>
</columns>
<ColumnListItem class="nwEpmRefappsShopTableItemLayout" id="columnListItem" type="Active" vAlign="Middle">
<cells>
.
.
</cells>
</ColumnListItem>
</Table>
这是我的home.controller.js
:
insContent: function () {
// Get data from input
this.byId("iname").getValue();
this.byId("isurname").getValue();
}