0

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
5367 4 9
https://github.com/chillw...

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
}
delete flag offensive retag edit

Comments

What class is expenses?

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

1 Answer

Sort by ยป oldest newest most voted
0

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?

Best,

Darksu

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

Follow
1 follower

RSS

Stats

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

Seen: 33 times

Last updated: Oct 11 '15

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