-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I am using grid,in single grid adding multiple rows,when adding multiple rows that grid shows top to bottom, but we need bottom to top. how can i rectify this issue.
please follow below code,
<grid sizedByContent="true" span="true" class="grid_align" model="@load(vm.expenses)" emptyMessage="No Records Found">
<columns>
<column label="Date of Expense" align="center"><h:strong style="color:red">*</h:strong></column>
<column label="Expense Type" align="center" width="150px"><h:strong style="color:red">*</h:strong></column>
<column label="Expense Amount" align="center"><h:strong style="color:red">*</h:strong></column>
<column label="Narrations" align="center" ><h:strong style="color:red">*</h:strong></column>
<column label="Bill Attachment" align="center"></column>
</columns>
<rows>
<template name="model">
<row>
<datebox value="@bind(each.exDate)" disabled="@bind(each.submitted)" constraint="no empty,no future"></datebox>
<combobox model="@load(vm.expCharges)" selectedItem="@bind(each.charge)" disabled="@bind(each.reimbSubmitted)" readonly="@bind(each.reimbSubmitted)" >
<template name="model">
<comboitem value="@load(each.charge_ID)" label="@load(each.name)"></comboitem>
</template>
</combobox>
<intbox value="@bind(each.amount)" disabled="@bind(each.submitted)"></intbox>
<textbox value="@bind(each.remarks)" disabled="@bind(each.submitted)" width="300px"></textbox>
<fileupload upload="true" label="Choose File" onUpload = "@command('uploadFilePettyCash',UEvent = event)" ></fileupload>
</row>
</template>
</rows>
</grid>
Java Code is....
@Command
@NotifyChange({"expenses","addRequest","requestGrid"})
public void addRequestPettyCash() throws IOException
{
isAddRequest = true;
isRequestGrid = true;
expenses.add(0, new Expense());//model class
}
Asked: 2015-10-10 11:07:39 +0800
Seen: 33 times
Last updated: Oct 11 '15
What class is expenses?
chillworld ( 2015-10-10 12:17:53 +0800 )edit