Hi everybody,
I have another question I cannot solve ...
I make a simple listgrid, and on the page loading, I cannot use the fliter (no call is made at all), unless I hardcode a first call to my datasource. Is that the way the things must work, or is there something I missed?
Here is the listGrid generation code :
And here is the dummy call I have to do to make the filter work :
Thanks for your replies!
I have another question I cannot solve ...
I make a simple listgrid, and on the page loading, I cannot use the fliter (no call is made at all), unless I hardcode a first call to my datasource. Is that the way the things must work, or is there something I missed?
Here is the listGrid generation code :
Code:
ListGridField ituCode = new ListGridField("itucode","Itu Code");
ituCode.setFrozen(true);
ituCode.setWidth(120);
ListGridField lastStatus = new ListGridField("lastStatus","Last Status");
lastStatus.setAlign(Alignment.CENTER);
lastStatus.setType(ListGridFieldType.IMAGE);
lastStatus.setImageURLPrefix("status/");
lastStatus.setImageURLSuffix(".gif");
lastStatus.setImageWidth(32);
lastStatus.setImageHeight(24);
lastStatus.setFrozen(true);
lastStatus.setWidth(75);
ListGridField terminals = new ListGridField("terminals","Departure Terminal<br/>Destination Terminal<br/>Final Terminal");
terminals.setWidth(150);
ListGridField fullOrEmpty = new ListGridField("fullOrEmpty","Full/Empty");
fullOrEmpty.setWidth(100);
ListGridField weights = new ListGridField("weights","Net Weight (kg)<br/>Gross Weight(kg)");
weights.setWidth(150);
ListGridField statusDate = new ListGridField("statusDate","Status Date");
statusDate.setWidth(200);
ListGridField departureDate = new ListGridField("departureDate","Departure Date");
departureDate.setWidth(200);
ListGridField actors = new ListGridField("actors","Invoicing<br/>Sender<br/>Receiver");
actors.setWidth(250);
ListGridField refNumbers = new ListGridField("refNumbers","Customer Ref<br/>Operator Ref");
refNumbers.setWidth(200);
ListGridField controlNumbers = new ListGridField("controlNumbers","Ctrl train Number<br/>Railway train number<br/>Wagon number");
controlNumbers.setWidth(200);
listGrid.setFields(ituCode,lastStatus,terminals,fullOrEmpty,weights,statusDate,departureDate,actors,refNumbers,controlNumbers);
listGrid.setWidth100();
listGrid.setHeight("300px");
listGrid.setHeaderHeight(50);
listGrid.setCellHeight(50);
listGrid.setDataPageSize(50);
listGrid.setAutoFetchData(true);
listGrid.setShowFilterEditor(true);
listGrid.setFilterOnKeypress(true);
listGrid.setDataSource(dataSource);
Code:
Criteria c = new Criteria();
dataSource.fetchData(c,new DSCallback () {
public void execute(DSResponse response, Object rawData, DSRequest request) {
listGrid.setData(response.getData());
}
});