• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EditorGrid类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



EditorGrid类属于com.extjs.gxt.ui.client.widget.grid包,在下文中一共展示了EditorGrid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);

	
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:18,代码来源:EditableCIInstanceGrid.java


示例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?");
	
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:26,代码来源:EditableCIInstanceGrid.java


示例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;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:29,代码来源:ProjectIndicatorManagementView.java


示例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;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:21,代码来源:ValueLabelField.java


示例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);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:36,代码来源:CMDBModelSaveWindow.java


示例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);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:36,代码来源:CMDBModelClearWindow.java


示例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);
	}
	
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:16,代码来源:AttributeGrid.java


示例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);
    }
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:35,代码来源:SiteGridPanel.java


示例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);
		}
	});
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:14,代码来源:ValueLabelField.java


示例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;
       
	
}
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:38,代码来源:SelectPayPanel.java


示例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();
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:42,代码来源:GroupTableWidget.java


示例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;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:5,代码来源:TripletsListElementDTO.java


示例13: getSectionsGrid

import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
@Override
public EditorGrid<ProjectReportModelSectionDTO> getSectionsGrid() {

	return this.sectionsGrid;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:6,代码来源:ReportModelsAdminView.java


示例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);
	
}
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:62,代码来源:ShippingPanel.java


示例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);
       
}
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:51,代码来源:PayPanel.java


示例16: initailOrderActionPanel

import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public ContentPanel initailOrderActionPanel()
{
	
	if( null != theOrderInfo.getString(IOrder.ID) && !(theOrderInfo.getString(IOrder.ID).equals("")))
	{
		orderID = theOrderInfo.getString(IOrder.ID);
	}
	orderActionCri.addCondition(new Condition(IOrderAction.ORDER, Condition.EQUALS, orderID));
	int pageSize = 10;
	
	BasePagingLoader loader = new PagingListService().getLoader(ModelNames.ORDERACTION, orderActionCri);
	loader.load(0, 10);
	ListStore<BeanObject> orderActionStore = new ListStore<BeanObject>(loader);
	List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
	Grid<BeanObject> grid;
	
	toolBar = new PagingToolBar(10);
	toolBar.bind(loader);
	//The beanobject in table is IOrderGoods
   	columns.add(new ColumnConfig(IOrderAction.ACTIONUSER, "操作者", 80));
   	columns.add(new ColumnConfig(IOrderAction.LOGTIME, "操作时间", 200));
	columns.add(new ColumnConfig(IOrderAction.ORDERSTATUS, "订单状态", 100));
	columns.add(new ColumnConfig(IOrderAction.SHIPPINGSTATUS, "发货状态", 80));
       columns.add(new ColumnConfig(IOrderAction.PAYSTATUS, "付款状态", 80));
       columns.add(new ColumnConfig(IOrderAction.NOTE, "备注", 200));
       
       ColumnModel cm = new ColumnModel(columns);
       grid = new EditorGrid<BeanObject>(orderActionStore, cm);
       grid.setLoadMask(true);
       grid.setBorders(true);
       grid.setSize(750, 200);
       
   	
       final ContentPanel panel = new ContentPanel();
       panel.setFrame(true);
       panel.setCollapsible(true);
       panel.setButtonAlign(HorizontalAlignment.CENTER);
       panel.add(grid);
       panel.setSize(780, 200);
       panel.setBottomComponent(toolBar);
       return panel;
}
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:43,代码来源:ShowOrderPanel.java


示例17: initailGoodsListPanel

import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
public ContentPanel initailGoodsListPanel()
	{
		int pageSize = 1;
    	
    	store = new ListStore<BeanObject>();
    	
    	toolBar = new PagingToolBar(pageSize);
		//The beanobject in table is IOrderGoods
    	columns.add(new ColumnConfig(IOrderGoods.ID, "物件", 80));
    	columns.add(new ColumnConfig(IOrderGoods.GOODS, "商品编号", 100));
		columns.add(new ColumnConfig(IOrderGoods.GOODSNAME, "商品名称", 100));
		columns.add(new ColumnConfig(IOrderGoods.GOODSSN, "货号", 80));
        columns.add(new ColumnConfig(IOrderGoods.GOODSPRICE, "价格", 80));
        
        ColumnConfig noColumn = new ColumnConfig(IOrderGoods.GOODSNUMBER, "数量", 80);
        
        columns.add(noColumn);
        
        
        columns.add(new ColumnConfig(IOrderGoods.MARKETPRICE, "小计", 80));
        
        ColumnConfig actcol = new ColumnConfig("Action", Resources.constants.action(), 80);
        columns.add(actcol);
        
        ColumnModel cm = new ColumnModel(columns);
        grid = new EditorGrid<BeanObject>(store, cm);
        grid.setLoadMask(true);
        grid.setBorders(true);
        grid.setSize(750, 200);
        
        //add a deleteOrdergoodsAction to table
        ActionCellRenderer render = new ActionCellRenderer(grid);
        ActionCellRenderer.ActionInfo act = null;
        act = new ActionCellRenderer.ActionInfo();
//        act.setText(" 删除");
        act.setImage("icon_trash.gif");
		act.setAction("deleteOrderGoods($id)");
		render.addAction(act);
              
        actcol.setRenderer(render);
    	
        final ContentPanel panel = new ContentPanel();
        panel.setFrame(true);
        panel.setCollapsible(true);
        panel.setButtonAlign(HorizontalAlignment.CENTER);
        panel.add(grid);
        panel.setSize(780, 200);
        panel.setBottomComponent(toolBar);
        return panel;
	}
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:51,代码来源:SelectGoodsPanel.java


示例18: onRender

import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
		super.onRender(parent, index);
		BasePagingLoader loader = new PagingListService().getLoader(
				ModelNames.USERRANK, criteria);
		loader.load(0, 10);

		final ListStore<BeanObject> 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(IUserRank.NAME, "会员等级名称", 100));
		columns.add(new ColumnConfig(IUserRank.MINPOINTS, "积分下限", 70));
		columns.add(new ColumnConfig(IUserRank.MAXPOINTS, "积分上限", 70));
		columns.add(new ColumnConfig(IUserRank.DISCOUNT, "初始折扣率", 70));
//		columns.add(new CheckColumnConfig(IUserRank.SPECIAL, "特殊会员组", 120));
//		columns.add(new CheckColumnConfig(IUserRank.SHOWPRICE, "显示价格", 80));

		ColumnConfig actcol = new ColumnConfig("Action", Resources.constants
				.GoodsList_action(), 120);
		columns.add(actcol);

		ColumnModel cm = new ColumnModel(columns);

		Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
		grid.setLoadMask(true);
		grid.setBorders(true);
		grid.setSelectionModel(smRowSelection);

		ActionCellRenderer render = new ActionCellRenderer(grid);
		ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
		act = new ActionCellRenderer.ActionInfo();
		
		act.setImage("icon_edit.gif");
		act.setAction("updateMemberAction($id)");
		act.setTooltip("编辑");
		render.addAction(act);
		
		act = new ActionCellRenderer.ActionInfo();
		act.setImage("icon_trash.gif");
		act.setAction("deleteMemberAction($id)");
		act.setTooltip("删除");
		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.setIconStyle("icon-table");
		panel.setHeading("会员等级");
		panel.setLayout(new FitLayout());
		panel.add(grid);
        panel.setHeight(500);
        panel.setWidth("100%");
		panel.setBottomComponent(toolBar);

//		panel.setButtonAlign(HorizontalAlignment.CENTER);
//		panel.addButton(new com.extjs.gxt.ui.client.widget.button.Button(
//				"添加会员级别", new SelectionListener<ButtonEvent>() {
//					public void componentSelected(ButtonEvent ce) {
//					    NewMemberLevel.State state = new NewMemberLevel.State();
//					    state.execute();
//					}
//				}));

		add(panel);

        Window.addResizeHandler(new ResizeHandler() {
            public void onResize(ResizeEvent event) {
                int w = event.getWidth() - 300;
                panel.setWidth(w + "px");
            }
        });
	}
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:80,代码来源:MemberLevelList.java


示例19: onRender

import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
    	super.onRender(parent, index);

        BasePagingLoader loader = new PagingListService().getLoader(ModelNames.CATEGORY);

        loader.load(0, 50);
    	
        final ListStore<BeanObject> store = new ListStore<BeanObject>(loader);

        store.addStoreListener(new StoreListener<BeanObject>() {
            public void storeUpdate(StoreEvent<BeanObject> se) {
                List<Record> changed = store.getModifiedRecords();
            }
        });
        
        toolBar = new PagingToolBar(50);
        toolBar.bind(loader);

        List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
        //CheckBoxSelectionModel<BeanObject> sm = new CheckBoxSelectionModel<BeanObject>();
        //columns.add(sm.getColumn());        
        columns.add(new ColumnConfig(ICategory.NAME, "分类名称", 150));
        columns.add(new ColumnConfig(ICategory.MEASUREUNIT, "数量单位", 80));
        columns.add(new CheckColumnConfig(ICategory.SHOWINNAVIGATOR, "导航栏", 80));
        columns.add(new CheckColumnConfig(ICategory.SHOW, "是否显示", 80));        
        columns.add(new ColumnConfig(ICategory.GRADE, "价格分级", 60));
        columns.add(new ColumnConfig(ICategory.SORTORDER, "排序", 50));        
        ColumnConfig actcol = new ColumnConfig("Action", "操作", 150);
        columns.add(actcol);

        ColumnModel cm = new ColumnModel(columns);

        Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
        grid.setLoadMask(true);
        grid.setBorders(true);
        //grid.setSelectionModel(sm);
//        grid.setAutoExpandColumn("forum");


        ActionCellRenderer render = new ActionCellRenderer(grid);
        ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();        
        act.setText("编辑 ");
        act.setAction("changeCategory($id)");
        render.addAction(act);
        act = new ActionCellRenderer.ActionInfo();
        act.setText(" 删除");
		act.setAction("deleteCategory($id)");
		act.setTooltip(Resources.constants.GoodsList_action_delete());
		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.setIconStyle("icon-table");
        panel.setHeading("Paging Grid");
        panel.setLayout(new FitLayout());
        panel.add(grid);
        panel.setHeight(500);
        panel.setWidth("100%");
        panel.setBottomComponent(toolBar);
        
//        panel.setButtonAlign(HorizontalAlignment.CENTER);
//        panel.addButton(new com.extjs.gxt.ui.client.widget.button.Button("添加分类", new SelectionListener<ButtonEvent>() {
//          public void componentSelected(ButtonEvent ce) {
//              NewCategory.State state = new NewCategory.State();
//              state.execute();
//          }
//        }));
//        
        add(panel);        
        
        Window.addResizeHandler(new ResizeHandler() {
            public void onResize(ResizeEvent event) {
                int w = event.getWidth() - 300;
                panel.setWidth(w + "px");
            }
        });
    }
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:82,代码来源:CategoryInfo.java


示例20: onRender

import com.extjs.gxt.ui.client.widget.grid.EditorGrid; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
    	super.onRender(parent, index);

        BasePagingLoader loader = new PagingListService().getLoader(ModelNames.BRAND);

        loader.load(0, 50);
    	
        final ListStore<BeanObject> store = new ListStore<BeanObject>(loader);

        store.addStoreListener(new StoreListener<BeanObject>() {
            public void storeUpdate(StoreEvent<BeanObject> se) {
                List<Record> changed = store.getModifiedRecords();
            }
        });
        
        toolBar = new PagingToolBar(50);
        toolBar.bind(loader);

        List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
        //CheckBoxSelectionModel<BeanObject> sm = new CheckBoxSelectionModel<BeanObject>();
        //columns.add(sm.getColumn());        
        columns.add(new ColumnConfig(IBrand.NAME, "品牌名称", 80));
        columns.add(new ColumnConfig(IBrand.SITE, "品牌网址", 150));
        columns.add(new ColumnConfig(IBrand.DESC, "品牌描述", 230));
        columns.add(new ColumnConfig(IBrand.ORDER, "排序", 50));
        columns.add(new CheckColumnConfig(IBrand.SHOW, "是否显示", 80));
        ColumnConfig actcol = new ColumnConfig("Action", "操作", 140);
        columns.add(actcol);

        ColumnModel cm = new ColumnModel(columns);

        final Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
        grid.setLoadMask(true);
        grid.setBorders(true);
        //grid.setSelectionModel(sm);
//        grid.setAutoExpandColumn("forum");

        ActionCellRenderer render = new ActionCellRenderer(grid);
        ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();        
        act.setText("编辑 ");
        act.setAction("changeBrand($id)");
        act.setTooltip(Resources.constants.GoodsList_action_edit());
        render.addAction(act);
        act = new ActionCellRenderer.ActionInfo();
        act.setText(" 删除");
		act.setAction("deleteBrand($id)");
		act.setTooltip(Resources.constants.GoodsList_action_delete());
		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.setIconStyle("icon-table");
        panel.setHeading("Paging Grid");
        panel.setLayout(new FitLayout());
        panel.add(grid);
        panel.setSize("100%", "500");
        panel.setBottomComponent(toolBar);     
//        panel.setButtonAlign(HorizontalAlignment.CENTER);
//        panel.addButton(new com.extjs.gxt.ui.client.widget.button.Button("添加品牌", new SelectionListener<ButtonEvent>() {
//          public void componentSelected(ButtonEvent ce) {
//              NewBrand.State state = new NewBrand.State();
//              state.execute();
//          }
//        }));
        
        Window.addResizeHandler(new ResizeHandler() {
            public void onResize(ResizeEvent event) {
                int w = event.getWidth() - 300;
                panel.setWidth(w + "px");
            }
        });
        
        add(panel);       
    }
 
开发者ID:jbosschina,项目名称:jcommerce,代码行数:79,代码来源:BrandInfo.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Pointer类代码示例发布时间:2022-05-23
下一篇:
Java MultiRowMutationProtocol类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap