Grid Issue when add multiple rows

asked 2015-10-10 11:07:39 +0800

sathishk gravatar image sathishk
17 5

updated 2015-10-10 12:15:25 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9

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">
    <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>
    <template name="model">
            <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>
            <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>                                                        

Java Code is....

public void addRequestPettyCash() throws IOException
    isAddRequest = true;
    isRequestGrid = true;
    expenses.add(0, new Expense());//model class
delete flag offensive retag edit


What class is expenses?

chillworld ( 2015-10-10 12:17:53 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-11 22:14:00 +0800

Darksu gravatar image Darksu
1991 1 4

Hello sathishk,

Why not add a primary key and then sort the data asc or desc based on the key?



link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2015-10-10 11:07:39 +0800

Seen: 32 times

Last updated: Oct 11 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More