当前位置: 首页>>代码示例>>Java>>正文


Java Grid.setSelectionModel方法代码示例

本文整理汇总了Java中com.extjs.gxt.ui.client.widget.grid.Grid.setSelectionModel方法的典型用法代码示例。如果您正苦于以下问题:Java Grid.setSelectionModel方法的具体用法?Java Grid.setSelectionModel怎么用?Java Grid.setSelectionModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.extjs.gxt.ui.client.widget.grid.Grid的用法示例。


在下文中一共展示了Grid.setSelectionModel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createGrid

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入方法依赖的package包/类
/**
 * Creates a new {@link Grid} instance for the given {@code columnConfigs}.
 *
 * @param columnConfigs
 *          The columns configurations list.
 * @param autoExpandColumn
 *          The auto expand column.
 * @return The grid component.
 */
private static <T extends ModelData> Grid<T> createGrid(final List<ColumnConfig> columnConfigs, final String autoExpandColumn) {

	final Grid<T> grid = new Grid<T>(new ListStore<T>(), new ColumnModel(columnConfigs));

	grid.setStyleAttribute("borderTop", "none");
	grid.setBorders(false);
	grid.setStripeRows(true);
	grid.setSelectionModel(new GridSelectionModel<T>());
	grid.setAutoExpandColumn(autoExpandColumn);
	grid.getView().setForceFit(true);

	return grid;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:23,代码来源:UsersAdminView.java

示例2: createGrid

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入方法依赖的package包/类
private Grid<ImportDetails> createGrid(final ColumnModel columnModel, final GridSelectionModel<ImportDetails> selectionModel) {
	final Grid<ImportDetails> grid = new Grid<ImportDetails>(new ListStore<ImportDetails>(), columnModel);
	
	grid.setSelectionModel(selectionModel);
	grid.getView().setForceFit(true);
	
	return grid;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:9,代码来源:ImportDetailsPopup.java

示例3: createGrid

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入方法依赖的package包/类
/**
 * Creates the grid of this popup.
 * 
 * @param columnModel
 * @param selectionModel
 * @return 
 */
private Grid<ElementExtractedValue> createGrid(final ColumnModel columnModel, final GridSelectionModel<ElementExtractedValue> selectionModel) {
	final Grid<ElementExtractedValue> grid = new Grid<ElementExtractedValue>(new ListStore<ElementExtractedValue>(), columnModel);
	
	grid.setSelectionModel(selectionModel);
	grid.getView().setForceFit(true);
	
	return grid;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:16,代码来源:ElementExtractedValuePopup.java

示例4: createCalendarsGridPanel

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入方法依赖的package包/类
/**
 * Creates the calendars panel + grid.
 * 
 * @return The calendars panel.
 */
private Component createCalendarsGridPanel() {

	// Calendars panel.
	final ContentPanel calendarsPanel = Panels.content(I18N.CONSTANTS.projectTabCalendar());

	// Calendars grid.
	final ColumnConfig calendarName = new ColumnConfig("name", I18N.CONSTANTS.name(), 180);
	final ColumnConfig calendarColor = new ColumnConfig("color", "", 20);
	calendarColor.setStyle("");
	calendarColor.setRenderer(new GridCellRenderer<CalendarWrapper>() {

		@Override
		public Object render(CalendarWrapper model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<CalendarWrapper> store,
				Grid<CalendarWrapper> grid) {

			final SimplePanel panel = new SimplePanel();
			panel.setPixelSize(14, 14);
			panel.getElement().getStyle().setMarginLeft(3, Unit.PX);

			panel.setStyleName("calendar-fullday-event-" + model.getCalendar().getStyle());
			return panel;
		}
	});

	selectionModel = new CheckBoxSelectionModel<CalendarWrapper>();

	final ColumnModel calendarColumnModel = new ColumnModel(Arrays.asList(selectionModel.getColumn(), calendarName, calendarColor));

	calendarsStore = new ListStore<CalendarWrapper>();

	final Grid<CalendarWrapper> calendarGrid = new Grid<CalendarWrapper>(calendarsStore, calendarColumnModel);
	calendarGrid.setAutoExpandColumn("name");
	calendarGrid.setSelectionModel(selectionModel);
	calendarGrid.addPlugin(selectionModel);

	calendarGrid.getView().setForceFit(true);

	calendarsPanel.add(calendarGrid);
	return calendarsPanel;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:46,代码来源:CalendarView.java


注:本文中的com.extjs.gxt.ui.client.widget.grid.Grid.setSelectionModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。