本文整理汇总了Java中com.smartgwt.client.widgets.grid.events.DataArrivedEvent类的典型用法代码示例。如果您正苦于以下问题:Java DataArrivedEvent类的具体用法?Java DataArrivedEvent怎么用?Java DataArrivedEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataArrivedEvent类属于com.smartgwt.client.widgets.grid.events包,在下文中一共展示了DataArrivedEvent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAdvancedOptions
import com.smartgwt.client.widgets.grid.events.DataArrivedEvent; //导入依赖的package包/类
private Canvas createAdvancedOptions() {
formCatalog = createCatalogForm();
lgResult = new ListGrid();
lgResult.setDataSource(BibliographyQueryDataSource.getInstance());
// lgResult.setUseAllDataSourceFields(true);
ListGridField preview = new ListGridField(BibliographyQueryDataSource.FIELD_PREVIEW,
i18n.CatalogBrowser_HeaderPreview_Title());
ListGridField title = new ListGridField(BibliographyQueryDataSource.FIELD_TITLE,
i18n.CatalogBrowser_HeaderTitle_Title());
lgResult.setDetailField(BibliographyQueryDataSource.FIELD_PREVIEW);
lgResult.setFields(title, preview);
// lgResult.setAutoFetchData(true);
lgResult.setHeight100();
lgResult.setWidth100();
lgResult.setCanExpandRecords(true);
lgResult.setCanExpandMultipleRecords(false);
lgResult.setExpansionMode(ExpansionMode.DETAIL_FIELD);
lgResult.setSelectionType(SelectionStyle.SINGLE);
// lgResult.setSelectionAppearance(SelectionAppearance.CHECKBOX);
lgResult.setAlternateRecordStyles(true);
lgResult.addDataArrivedHandler(new DataArrivedHandler() {
@Override
public void onDataArrived(DataArrivedEvent event) {
if (event.getStartRow() == 0 && event.getEndRow() > 0) {
lgResult.focus();
lgResult.selectSingleRecord(0);
}
}
});
VLayout layout = new VLayout();
layout.setMembers(formCatalog, lgResult);
layout.setMargin(4);
layout.setMembersMargin(4);
layout.setOverflow(Overflow.AUTO);
return layout;
}
示例2: initData
import com.smartgwt.client.widgets.grid.events.DataArrivedEvent; //导入依赖的package包/类
private void initData() {
listGrid.addDataArrivedHandler(new DataArrivedHandler() {
@Override
public void onDataArrived(DataArrivedEvent event) {
listGrid.expandRecord(listGrid.getRecord(0));
listGrid.selectRecord(0);
}
});
loadDataIntoListGrid();
}
示例3: onDataArrived
import com.smartgwt.client.widgets.grid.events.DataArrivedEvent; //导入依赖的package包/类
@Override
public void onDataArrived(com.smartgwt.client.widgets.form.fields.events.DataArrivedEvent event) {
onChanged(null);
}
示例4: createList
import com.smartgwt.client.widgets.grid.events.DataArrivedEvent; //导入依赖的package包/类
private ListGrid createList() {
final ListGrid grid = new ListGrid();
grid.addDataArrivedHandler(new DataArrivedHandler() {
@Override
public void onDataArrived(DataArrivedEvent event) {
int startRow = event.getStartRow();
int endRow = event.getEndRow();
if (startRow == 0 && endRow >= 0) {
grid.focus();
grid.selectSingleRecord(0);
} else if (endRow < 0) {
grid.deselectAllRecords();
}
}
});
grid.setSelectionType(SelectionStyle.SINGLE);
grid.setCanSort(false);
grid.setDataSource(SearchDataSource.getInstance());
ListGridField label = new ListGridField(SearchDataSource.FIELD_LABEL,
i18n.DigitalObjectSearchView_ListHeaderLabel_Title());
ListGridField model = new ListGridField(SearchDataSource.FIELD_MODEL,
i18n.DigitalObjectSearchView_ListHeaderModel_Title(), 150);
model.setAlign(Alignment.CENTER);
ListGridField pid = new ListGridField(SearchDataSource.FIELD_PID,
i18n.DigitalObjectSearchView_ListHeaderPid_Title(), 100);
pid.setAlign(Alignment.CENTER);
ListGridField created = new ListGridField(SearchDataSource.FIELD_CREATED,
i18n.DigitalObjectSearchView_ListHeaderCreated_Title(), 100);
created.setAlign(Alignment.CENTER);
ListGridField modified = new ListGridField(SearchDataSource.FIELD_MODIFIED,
i18n.DigitalObjectSearchView_ListHeaderModified_Title(), 100);
modified.setAlign(Alignment.CENTER);
ListGridField owner = new ListGridField(SearchDataSource.FIELD_OWNER,
i18n.DigitalObjectSearchView_ListHeaderOwner_Title(), 100);
ListGridField state = new ListGridField(SearchDataSource.FIELD_STATE,
i18n.DigitalObjectSearchView_ListHeaderState_Title(), 100);
state.setHidden(true);
ListGridField export = new ListGridField(SearchDataSource.FIELD_EXPORT,
i18n.DigitalObjectSearchView_ListHeaderExport_Title(), 100);
export.setCellFormatter(new CellFormatter() {
@Override
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
return value == null || "0".equals(value)
? i18nSmartGwt.dialog_NoButtonTitle()
: i18nSmartGwt.dialog_YesButtonTitle();
}
});
grid.setFields(label, model, pid, created, modified, owner, state, export);
grid.setContextMenu(Actions.createMenu());
grid.addSelectionUpdatedHandler((event) -> {
selectionCache.setSelection();
});
return grid;
}