本文整理汇总了Java中com.extjs.gxt.ui.client.widget.grid.EditorGrid.setView方法的典型用法代码示例。如果您正苦于以下问题:Java EditorGrid.setView方法的具体用法?Java EditorGrid.setView怎么用?Java EditorGrid.setView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.extjs.gxt.ui.client.widget.grid.EditorGrid
的用法示例。
在下文中一共展示了EditorGrid.setView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGridModel
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入方法依赖的package包/类
private EditorGrid<SaveItem> getGridModel(ContentData mdr, ListStore<SaveItem> store, boolean saveInstances) {
List<ColumnConfig> config = new ArrayList<ColumnConfig>();
config.add(EditorFactory.getColumn(mdr, "ci", "Template", 100, false, "xs:string", 1, false, false));
if (saveInstances) {
config.add(EditorFactory.getColumn(mdr, "saveInstances", "Instances", 60, true, "xs:boolean", 1, false, false));
}
config.add(EditorFactory.getColumn(mdr, "saveTemplates", "Templates", 60, true, "xs:boolean", 1, false, false));
config.add(EditorFactory.getColumn(mdr, "allChildren", "All Children", 60, true, "xs:boolean", 1, false, false));
final ColumnModel cm = new ColumnModel(config);
GroupingView view = new GroupingView();
view.setForceFit(true);
view.setGroupRenderer(new GridGroupRenderer() {
public String render(GroupColumnData data) {
String f = cm.getColumnById(data.field).getHeader();
String l = data.models.size() == 1 ? "Item" : "Items";
return f + ": " + data.group + " (" + data.models.size() + " " + l + ")";
}
});
EditorGrid<SaveItem> grid = new EditorGrid<SaveItem>(store, cm);
grid.setView(view);
grid.setBorders(true);
for (ColumnConfig cfg : config) {
if (cfg instanceof CheckColumnConfig) {
grid.addPlugin((ComponentPlugin)cfg);
}
}
store.setStoreSorter(null);
return(grid);
}
示例2: getGridModel
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入方法依赖的package包/类
private EditorGrid<SaveItem> getGridModel(ContentData mdr, ListStore<SaveItem> store, boolean saveInstances) {
List<ColumnConfig> config = new ArrayList<ColumnConfig>();
config.add(EditorFactory.getColumn(mdr, "ci", "Template", 100, false, "xs:string", 1, false, false));
if (saveInstances) {
config.add(EditorFactory.getColumn(mdr, "saveInstances", "Instance(s)", 60, true, "xs:boolean", 1, false, false));
}
config.add(EditorFactory.getColumn(mdr, "saveTemplates", "Template(s)", 60, true, "xs:boolean", 1, false, false));
config.add(EditorFactory.getColumn(mdr, "allChildren", "All Children", 60, true, "xs:boolean", 1, false, false));
final ColumnModel cm = new ColumnModel(config);
GroupingView view = new GroupingView();
view.setForceFit(true);
view.setGroupRenderer(new GridGroupRenderer() {
public String render(GroupColumnData data) {
String f = cm.getColumnById(data.field).getHeader();
String l = data.models.size() == 1 ? "Item" : "Items";
return f + ": " + data.group + " (" + data.models.size() + " " + l + ")";
}
});
EditorGrid<SaveItem> grid = new EditorGrid<SaveItem>(store, cm);
grid.setView(view);
grid.setBorders(true);
for (ColumnConfig cfg : config) {
if (cfg instanceof CheckColumnConfig) {
grid.addPlugin((ComponentPlugin)cfg);
}
}
store.setStoreSorter(null);
return(grid);
}