本文整理了Java中com.extjs.gxt.ui.client.widget.grid.Grid.getSelectionModel()
方法的一些代码示例,展示了Grid.getSelectionModel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grid.getSelectionModel()
方法的具体详情如下:
包路径:com.extjs.gxt.ui.client.widget.grid.Grid
类名称:Grid
方法名:getSelectionModel
[英]Returns the grid's selection model.
[中]返回网格的选择模型。
代码示例来源:origin: com.extjs/gxt
@Override
protected void onKeyDown(ComponentEvent ce, int index) {
ce.cancelBubble();
if (grid.getSelectionModel() instanceof CellSelectionModel<?>) {
CellSelectionModel<?> csm = (CellSelectionModel<?>) grid.getSelectionModel();
csm.selectCell(0, index);
} else {
grid.getSelectionModel().select(0, false);
}
}
代码示例来源:origin: com.extjs/gxt
@Override
protected void initTemplates() {
super.initTemplates();
GridSelectionModel<ModelData> sm = grid.getSelectionModel();
sm.addListener(Events.BeforeSelect, new Listener<SelectionEvent<ModelData>>() {
public void handleEvent(SelectionEvent<ModelData> be) {
onBeforeRowSelect(be);
}
});
}
代码示例来源:origin: pl.touk.top/file-upload-gwtclient-lib
public void handleEvent(GridEvent event) {
KeyAndMouseSelectionModel.this.fireEvent(
KeyAndMouseSelectionModel.this.grid.getSelectionModel().getSelectedItem(),true, true);
}
});
代码示例来源:origin: bedatadriven/activityinfo
@Override
public M getSelection() {
GridSelectionModel<M> sm = grid.getSelectionModel();
if (sm instanceof CellSelectionModel) {
CellSelectionModel<M>.CellSelection cell = ((CellSelectionModel<M>) sm).getSelectCell();
return cell == null ? null : cell.model;
} else {
return sm.getSelectedItem();
}
}
代码示例来源:origin: geoserver/geofence
public void handleEvent(BaseEvent be) {
if (!grid.getSelectionModel().getSelection().isEmpty())
select.enable();
else
select.disable();
}
});
代码示例来源:origin: com.extjs/gxt
protected void onFocus(ComponentEvent ce) {
if (GXT.isFocusManagerEnabled()) {
if (getSelectionModel().selectedHeader != null) {
FocusFrame.get().frame(getSelectionModel().selectedHeader);
} else {
FocusFrame.get().frame(this);
}
}
}
代码示例来源:origin: com.extjs/gxt
protected void onKeyLeft(GridEvent<?> ce) {
if (grid.getSelectionModel().getSelectedItem() != null) {
collapseRow(grid.getStore().indexOf(grid.getSelectionModel().getSelectedItem()));
}
}
代码示例来源:origin: com.extjs/gxt
protected void onKeyRight(GridEvent<?> ce) {
if (grid.getSelectionModel().getSelectedItem() != null) {
expandRow(grid.getStore().indexOf(grid.getSelectionModel().getSelectedItem()));
}
}
代码示例来源:origin: pl.touk.top/file-upload-gwtclient-lib
@Override
protected void onKeyUp(GridEvent<BeanModel> ge) {
super.onKeyUp(ge);
fireEvent(grid.getSelectionModel().getSelectedItem(), false, false);
}
代码示例来源:origin: geoserver/geofence
@Override
public void select()
{
searchStatus.setBusy("Get User Details....");
Dispatcher.forwardEvent(GeofenceEvents.BIND_SELECTED_USER, grid.getSelectionModel().getSelectedItem());
}
代码示例来源:origin: bedatadriven/activityinfo
protected void onCellClick(GridEvent ge) {
M selection = (M) ge.getGrid().getSelectionModel().getSelectedItem();
if (lastSelection != selection) {
lastSelection = selection;
presenter.onSelectionChanged(selection);
}
}
代码示例来源:origin: pl.touk.top/file-upload-gwtclient-lib
@Override
protected void handleMouseDown(GridEvent<BeanModel> beanModelGridEvent) {
super.handleMouseDown(beanModelGridEvent);
fireEvent(grid.getSelectionModel().getSelectedItem(), false, true);
}
代码示例来源:origin: pl.touk.top/file-upload-gwtclient-lib
@Override
protected void onKeyDown(GridEvent<BeanModel> ge) {
super.onKeyDown(ge);
fireEvent(grid.getSelectionModel().getSelectedItem(), false, false);
}
代码示例来源:origin: pl.touk.tola/tola
public void handleEvent(GridEvent ge) {
FileDescriptorGxt ufb = grid.getSelectionModel().getSelectedItem();
GWT.log("downloading" + ufb.getFileName(), null);
download(GWT.getModuleBaseURL() + controllerUrl+"?" + CONTROLLER_DOWNLOAD+"&fileId="+ufb.getFileId());
}});
代码示例来源:origin: com.extjs/gxt
protected void onGridKey(GridEvent<M> e) {
int kc = e.getKeyCode();
if ((kc == KeyCodes.KEY_ENTER || (kc == 113 && GXT.isWindows)) && !isVisible()) {
M r = grid.getSelectionModel().getSelectedItem();
if (r != null) {
int index = this.grid.store.indexOf(r);
startEditing(index, true);
e.cancelBubble();
}
}
}
代码示例来源:origin: geoserver/geofence
/**
* Inits the grid.
*/
private void initGrid() {
ColumnModel cm = prepareColumnModel();
grid = new Grid<T>(store, cm);
grid.setBorders(true);
grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
grid.setHeight("95%");
grid.setLazyRowRender(0);
setGridProperties();
}
代码示例来源:origin: pl.touk/wonderful-security-lib
protected void afterGridRowDoubleClicked(GridEvent ge) {
Object selected = ge.getGrid().getSelectionModel().getSelectedItem();
AppEvent ae = new AppEvent(USER_GRID_DOUBLE_CLICK);
ae.setData("USER", ((BeanModel) selected).getBean());
Dispatcher.get().dispatch(ae);
}
代码示例来源:origin: pl.touk/wonderful-security-lib
protected void afterGridRowDoubleClicked(GridEvent ge) {
Object selected = ge.getGrid().getSelectionModel().getSelectedItem();
AppEvent ae = new AppEvent(ROLE_GRID_DOUBLE_CLICK);
ae.setData("ROLE", ((BeanModel) selected).getBean());
Dispatcher.get().dispatch(ae);
}
代码示例来源:origin: pl.touk/wonderful-security-lib
protected void afterGridRowDoubleClicked(GridEvent ge) {
Object selected = ge.getGrid().getSelectionModel().getSelectedItem();
AppEvent ae = new AppEvent(GROUP_GRID_DOUBLE_CLICK);
ae.setData("GROUP", ((BeanModel) selected).getBean());
Dispatcher.get().dispatch(ae);
}
代码示例来源:origin: com.extjs/gxt
public void handleEvent(DomEvent e) {
if (e.getType() == Events.Complete) {
EditorEvent ee = (EditorEvent) e;
onEditComplete((CellEditor) ee.getEditor(), ee.getValue(), ee.getStartValue());
} else if (e.getType() == Events.SpecialKey) {
grid.getSelectionModel().onEditorKey(e);
} else if (e.getType() == Events.CancelEdit) {
EditorEvent ee = (EditorEvent) e;
onEditCancel((CellEditor) ee.getEditor(), ee.getValue(), ee.getStartValue());
}
}
};
内容来源于网络,如有侵权,请联系作者删除!