本文整理汇总了Java中com.extjs.gxt.ui.client.widget.grid.EditorGrid类的典型用法代码示例。如果您正苦于以下问题:Java EditorGrid类的具体用法?Java EditorGrid怎么用?Java EditorGrid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EditorGrid类属于com.extjs.gxt.ui.client.widget.grid包,在下文中一共展示了EditorGrid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addNewItem
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
protected void addNewItem(EditorGrid<CIModelCollection> editGrid, CIModel newModel) {
CIModelCollection model = null;
if (newInstanceCallback != null) {
model = newInstanceCallback.createInstance(gridConfig);
} else {
model = gridConfig.createNewInstance(newModel);
}
editGrid.stopEditing();
// Disable Store Filter when we add.
StoreSorter sorter = store.getStoreSorter();
store.setStoreSorter(null);
store.insert(model, 0);
store.setStoreSorter(sorter);
editGrid.startEditing(0, 1);
}
示例2: selectNewTemplate
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
protected void selectNewTemplate(final EditorGrid<CIModelCollection> editGrid, Element target) {
List<String> types = new ArrayList<String>();
types.add(gridConfig.getNewModel().getAlias());
CITemplateBrowser template = new CITemplateBrowser(gridConfig.getMDR(), types);
//template.setCheckable(true, null);
final SelectContentPanel<CIModel> sel = new SelectContentPanel<CIModel>("Select a template", template);
final AdaptableMenu menu = new AdaptableMenu(sel, "");
menu.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
menu.hide();
CIModel model = sel.getValue();
addNewItem(editGrid, model);
}
});
menu.addListener(Events.Hide, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
menu.hide();
}
});
menu.show(target, "tl-bl?");
}
示例3: buildTreeGrid
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
/**
* Builds the tree grid component.
*
* @return The tree grid component.
*/
private TreeGrid<IndicatorElement> buildTreeGrid() {
// Columns
IndicatorResources.INSTANCE.css().ensureInjected();
final List<ColumnConfig> columns = createColumns();
// Store
final TreeStore<IndicatorElement> store = createTreeStore();
// Grid
treeGrid = createTreeGrid(store, columns);
treeGrid.setBorders(true);
treeGrid.getStyle().setNodeCloseIcon(null);
treeGrid.getStyle().setNodeOpenIcon(null);
treeGrid.getStyle().setLeafIcon(null);
treeGrid.setAutoExpandColumn(IndicatorDTO.NAME);
treeGrid.setTrackMouseOver(false);
treeGrid.setClicksToEdit(EditorGrid.ClicksToEdit.TWO);
// TODO: Add a SelectionModel
return treeGrid;
}
示例4: createGrid
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
private static EditorGrid<ValueLabel> createGrid() {
final EditorGrid<ValueLabel> grid = new EditorGrid<ValueLabel>(new ListStore<ValueLabel>(), createColumnModel());
grid.setAutoExpandColumn(LABEL_PROPERTY);
grid.setHeight(100);
grid.setBorders(true);
grid.getStore().add(new ValueLabel());
grid.addListener(Events.AfterEdit, new Listener<GridEvent<ValueLabel>>() {
@Override
public void handleEvent(GridEvent<ValueLabel> be) {
if(be.getRowIndex()+1 == grid.getStore().getCount() &&
(be.getModel().getLabel() != null)) {
grid.getStore().add(new ValueLabel());
}
}
});
return grid;
}
示例5: 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);
}
示例6: 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);
}
示例7: addAttribute
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public void addAttribute() {
if (grid instanceof EditorGrid) {
AttributeModel attribute = new AttributeModel();
attribute.setMaxOccur("1");
attribute.setMinOccur("1");
attribute.setDisplayName("New Attribute");
newAttributes.add(attribute);
//model.newAttribute(attribute);
((EditorGrid)grid).stopEditing();
store.insert(attribute, 0);
((EditorGrid)grid).startEditing(0, 0);
}
}
示例8: initGrid
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
/**
* A GXT grid can't be created without a column model, and since our column model is a function of the filter
* applied, we delay creating the control until load() is called above.
*
* @param model
*/
private void initGrid(ColumnModel model) {
if (grid == null) {
grid = new EditorGrid<SiteDTO>(store, model);
grid.setClicksToEdit(ClicksToEdit.TWO);
grid.addListener(Events.AfterEdit, new Listener<GridEvent<SiteDTO>>() {
@Override
public void handleEvent(GridEvent<SiteDTO> event) {
siteUpdated = true;
saveButton.setEnabled(true);
}
});
grid.setSelectionModel(new GridSelectionModel<SiteDTO>());
grid.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<SiteDTO>() {
@Override
public void selectionChanged(SelectionChangedEvent<SiteDTO> se) {
onSelectionChanged(se);
}
});
removeAll();
add(grid);
layout();
} else {
grid.reconfigure(store, model);
}
}
示例9: ValueLabelField
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public ValueLabelField() {
super(createGrid());
grid = (EditorGrid<ValueLabel>) this.getWidget();
store = grid.getStore();
grid.addListener(Events.AfterEdit, new Listener<GridEvent>() {
@Override
public void handleEvent(GridEvent be) {
Object oldValue = value;
value = valueFromStore();
fireChangeEvent(oldValue, value);
}
});
}
示例10: getPayPanel
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public static ContentPanel getPayPanel(){
List<String> wantedFields = new ArrayList<String>();
wantedFields.add(IOrder.PAYMENT);
wantedFields.add(IOrder.PAYNOTE);
BasePagingLoader loader = new PagingListService().getLoader(ModelNames.ORDER, wantedFields);
final ListStore<BeanObject> store = new ListStore<BeanObject>(loader);
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
final CheckBoxSelectionModel<BeanObject> smRowSelection = new CheckBoxSelectionModel<BeanObject>();
columns.add(smRowSelection.getColumn());
columns.add(new ColumnConfig(IOrder.PAYMENT, "名称", 80));
columns.add(new ColumnConfig(IOrder.PAYNOTE, "描述", 104));
columns.add(new ColumnConfig("handlingFee", "手续费", 80));
ColumnModel cm = new ColumnModel(columns);
Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setSize(750, 200);
final ContentPanel panel = new ContentPanel();
panel.setFrame(true);
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.setSize(750, 200);
panel.setLayout(new FitLayout());
panel.setHeading("选择支付方式");
panel.add(grid);
return panel;
}
示例11: initUI
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public void initUI() {
// Create Loader.
BasePagingLoader<BasePagingLoadConfig, BasePagingLoadResult<GroupCollection>> loader = new BasePagingLoader<BasePagingLoadConfig, BasePagingLoadResult<GroupCollection>>(desc.getProxy(id, (GroupCollection)getValue()));
// Create Store
ListStore<GroupCollection> store = new ListStore<GroupCollection>(loader);
store.setMonitorChanges(true);
// Create editor grid.
ColumnModel model = desc.getTableColumnModel(name, id, permissions);
EditorGrid<GroupCollection> grid = new EditorGrid<GroupCollection>(store, model);
for (int i = 0; i < model.getColumnCount(); i++) {
ColumnConfig cfg = model.getColumn(i);
if (cfg instanceof ComponentPlugin) {
grid.addPlugin((ComponentPlugin)cfg);
}
}
grid.setBorders(true);
grid.setLoadMask(true);
// Fill the component with the grid.
setLayout(new FitLayout());
// Add this for scrollbars!
ContentPanel panel = new ContentPanel();
panel.setHeaderVisible(false);
panel.setLayout(new FitLayout());
panel.add(grid);
PagingToolBar paging = new PageSizePagingToolBar(50);
paging.bind(loader);
panel.setBottomComponent(paging);
add(panel);
loader.load();
}
示例12: ActionListener
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public ActionListener(EditorGrid<TripletValueDTO> grid, boolean isAddAction) {
this.grid = grid;
this.isAddAction = isAddAction;
}
示例13: getSectionsGrid
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
@Override
public EditorGrid<ProjectReportModelSectionDTO> getSectionsGrid() {
return this.sectionsGrid;
}
示例14: ShippingPanel
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public ShippingPanel(Criteria criteria)
{
initJS(this);
store = new ListStore<BeanObject>();
new ListService().listBeans(ModelNames.SHIPPING, criteria, new ListService.Listener(){
public void onSuccess(List<BeanObject> beans)
{
for(int i=0; i<beans.size(); i++)
{
store.add(beans.get(i));
}
}
});
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
columns.add(new ColumnConfig(IShipping.NAME, "名称", 80));
columns.add(new ColumnConfig(IShipping.DESCRIPTION, "描述", 130));
columns.add(new ColumnConfig(IOrder.SHIPPINGFEE, "配送费", 80));
columns.add(new ColumnConfig("freeMoney", "免费额度", 80));
columns.add(new ColumnConfig(IShipping.INSURE, "保价费", 80));
ColumnConfig actcol = new ColumnConfig("Action", "操作", 100);
columns.add(actcol);
ColumnModel cm = new ColumnModel(columns);
Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setSize(750, 200);
ActionCellRenderer render = new ActionCellRenderer(grid);
ActionCellRenderer.ActionInfo act = null;
act = new ActionCellRenderer.ActionInfo();
act.setImage("yes.gif");
act.setAction("chooseShipping($id)");
render.addAction(act);
actcol.setRenderer(render);
ColumnPanel wantedInsure = new ColumnPanel();
wantedInsure.createPanel(IShipping.SUPPORTCOD, "我要保价", new CheckBox());
final ContentPanel panel = new ContentPanel();
panel.setFrame(true);
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.setLayout(new FitLayout());
panel.add(grid);
panel.add(wantedInsure);
panel.setBottomComponent(toolBar);
this.setSize(750, 555);
this.setHeading("选择配送方式");
this.add(panel);
}
示例15: PayPanel
import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public PayPanel(){
initJS(this);
Criteria criteria = new Criteria();
BasePagingLoader loader = new PagingListService().getLoader(ModelNames.PAYMENT, criteria);
loader.load(0, 10);
store = new ListStore<BeanObject>(loader);
toolBar = new PagingToolBar(10);
toolBar.bind(loader);
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
final CheckBoxSelectionModel<BeanObject> smRowSelection = new CheckBoxSelectionModel<BeanObject>();
columns.add(smRowSelection.getColumn());
columns.add(new ColumnConfig(IPayment.NAME, "名称", 80));
columns.add(new ColumnConfig(IPayment.DESCRIPTION, "描述", 200));
columns.add(new ColumnConfig(IPayment.FEE, "手续费", 80));
ColumnConfig actcol = new ColumnConfig("Action", "选取", 100);
columns.add(actcol);
ColumnModel cm = new ColumnModel(columns);
Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setSize(750, 200);
ActionCellRenderer render = new ActionCellRenderer(grid);
ActionCellRenderer.ActionInfo act = null;
act = new ActionCellRenderer.ActionInfo();
act.setImage("yes.gif");
act.setAction("choosePayment($id)");
render.addAction(act);
actcol.setRenderer(render);
final ContentPanel panel = new ContentPanel();
panel.setFrame(true);
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.setLayout(new FitLayout());
panel.add(grid);
this.setSize(750, 200);
this.setHeading("选择支付方式");
this.add(panel);
}