本文整理汇总了Java中com.extjs.gxt.ui.client.store.StoreEvent类的典型用法代码示例。如果您正苦于以下问题:Java StoreEvent类的具体用法?Java StoreEvent怎么用?Java StoreEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StoreEvent类属于com.extjs.gxt.ui.client.store包,在下文中一共展示了StoreEvent类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: storeBeforeAdd
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private void storeBeforeAdd(StoreEvent<ContactDTO> se) {
if (getLimit() > 0 && store.getCount() >= getLimit()) {
se.setCancelled(true);
return;
}
assert se.getModels().size() == 1;
ContactDTO contactDTO = se.getModels().get(0);
// Avoid selection of filtered type and models
if (getAllowedType() != null && contactDTO.getContactModel().getType() != getAllowedType()) {
se.setCancelled(true);
return;
}
if (getAllowedModelIds() != null && !getAllowedModelIds().isEmpty() && !getAllowedModelIds().contains(contactDTO.getContactModel().getId())) {
se.setCancelled(true);
return;
}
// XXX: verify the contact has TRUE for the checkboxElement defined in the ContactListElement ?
// (to do that we need to retrive this flexibleElement for all ContactDTO)
// Not very useful, the availableContactsStore only contains valid values and
// created contacts have the value set to TRUE
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:22,代码来源:ContactListElementDTO.java
示例2: handleEvent
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
@Override
public void handleEvent(StoreEvent<ContactDTO> e) {
EventType type = e.getType();
if (type == Store.BeforeAdd) {
storeBeforeAdd(e);
} else if (type == Store.Add) {
storeAdd(e);
} else if (type == Store.BeforeClear) {
storeBeforeClear();
} else if (type == Store.Clear) {
storeClear();
} if (type == Store.Remove) {
storeRemove(e);
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:16,代码来源:ContactListElementDTO.java
示例3: storeAdd
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private void storeAdd(StoreEvent<ContactDTO> se) {
handleChange(se.getModels(), ValueEventChangeType.ADD);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:4,代码来源:ContactListElementDTO.java
示例4: storeRemove
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private void storeRemove(StoreEvent<ContactDTO> se) {
handleChange(Collections.singletonList(se.getModel()), ValueEventChangeType.REMOVE);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:4,代码来源:ContactListElementDTO.java
示例5: prepareAfterGetContacts
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private Runnable prepareAfterGetContacts(ContentPanel mainPanel, final ListStore<ContactDTO> store) {
Runnable afterGetContacts;
final ToolBar actionsToolBar = new ToolBar();
actionsToolBar.setAlignment(HorizontalAlignment.LEFT);
actionsToolBar.add(Forms.button(I18N.CONSTANTS.addItem(), IconImageBundle.ICONS.add(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
showContactSelector(store);
}
}));
final Label offlineLabel = new Label(I18N.CONSTANTS.sigmahContactsOfflineUnavailable());
actionsToolBar.add(offlineLabel);
mainPanel.setTopComponent(actionsToolBar);
// if offline mode, no contact can be used
actionsToolBar.setEnabled(!Profiler.INSTANCE.isOfflineMode());
offlineLabel.setVisible(Profiler.INSTANCE.isOfflineMode());
if (eventBus != null) {
eventBus.addHandler(OfflineEvent.getType(), new OfflineHandler() {
@Override
public void handleEvent(OfflineEvent event) {
final boolean isOffline = ApplicationState.OFFLINE == event.getState();
actionsToolBar.setEnabled(!isOffline && !isReadOnly(store));
offlineLabel.setVisible(isOffline);
}
});
}
final Listener<StoreEvent<ContactDTO>> listener = new ContactStoreEventListener(store, actionsToolBar);
afterGetContacts = new Runnable() {
@Override
public void run() {
actionsToolBar.setEnabled(!Profiler.INSTANCE.isOfflineMode() && !isReadOnly(store));
store.addListener(Store.BeforeAdd, listener);
store.addListener(Store.Add, listener);
store.addListener(Store.BeforeClear, listener);
store.addListener(Store.Clear, listener);
store.addListener(Store.Remove, listener);
handlerManager.fireEvent(new RequiredValueEvent(store.getCount() > 0, true));
}
};
return afterGetContacts;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:50,代码来源:ContactListElementDTO.java
示例6: loadContactListOptions
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
public void loadContactListOptions(final ContactListElementDTO flexibleElement) {
view.getContactListModelsFilter().getListStore().removeAll();
view.getContactListModelsFilter().getAvailableValuesStore().removeAll();
view.getContactListModelsFilter().getListStore().addStoreListener(new StoreListener<ContactModelDTO>() {
@Override public void handleEvent(StoreEvent<ContactModelDTO> e) {
refreshContactListCheckboxElementField(flexibleElement);
}
});
// Show getContactListCheckboxElementFilter if exactly one allowedModelId is selected
if (flexibleElement != null && flexibleElement.getAllowedModelIds() != null && flexibleElement.getAllowedModelIds().size() == 1) {
view.getContactListClearableCheckboxElement().show();
view.getContactListCheckboxElementFilter().setValue(flexibleElement.getCheckboxElement());
} else {
view.getContactListClearableCheckboxElement().hide();
view.getContactListCheckboxElementFilter().setValue(null);
}
dispatch.execute(new GetContactModels(null, true, true), new AsyncCallback<ListResult<ContactModelDTO>>() {
@Override
public void onFailure(Throwable caught) {
Log.error("Error while getting available contact models.", caught);
}
@Override
public void onSuccess(ListResult<ContactModelDTO> result) {
availableContactModels = result.getList();
filterContactListModels(view.getContactListTypeFilter().getValue());
if (flexibleElement == null) {
return;
}
Set<Integer> allowedModels = flexibleElement.getAllowedModelIds();
if (allowedModels == null || allowedModels.isEmpty()) {
return;
}
for (ContactModelDTO contactModelDTO : result.getList()) {
if (allowedModels.contains(contactModelDTO.getId())) {
view.getContactListModelsFilter().getListStore().add(contactModelDTO);
view.getContactListModelsFilter().getAvailableValuesStore().remove(contactModelDTO);
}
}
}
});
view.getContactListTypeFilter().getStore().removeAll();
for (ContactModelType contactModelType : ContactModelType.values()) {
EnumModel<ContactModelType> enumModel = new EnumModel<ContactModelType>(contactModelType);
view.getContactListTypeFilter().getStore().add(enumModel);
if (flexibleElement != null && contactModelType == flexibleElement.getAllowedType()) {
view.getContactListTypeFilter().setValue(enumModel);
}
}
view.getContactListTypeFilter().removeAllListeners();
view.getContactListTypeFilter().addSelectionChangedListener(new SelectionChangedListener<EnumModel<ContactModelType>>() {
@Override
public void selectionChanged(final SelectionChangedEvent<EnumModel<ContactModelType>> event) {
view.getContactListModelsFilter().getListStore().removeAll();
view.getContactListClearableCheckboxElement().hide();
view.getContactListCheckboxElementFilter().setValue(null);
filterContactListModels(event.getSelectedItem());
if (event.getSelectedItem() != null && event.getSelectedItem().getEnum() == ContactModelType.ORGANIZATION) {
view.getContactIsMember().show();
} else {
view.getContactIsMember().hide();
view.getContactIsMember().setValue(false);
}
}
});
view.getContactListLimit().setValue(flexibleElement != null ? flexibleElement.getLimit() : null);
if (flexibleElement != null && flexibleElement.isMember()) {
view.getContactIsMember().show();
view.getContactIsMember().setValue(true);
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:81,代码来源:EditFlexibleElementAdminPresenter.java
示例7: createGrid
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private void createGrid() {
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);
Grid<BeanObject> grid = new Grid<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);
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(750, 350);
panel.setBottomComponent(toolBar);
panel.setButtonAlign(HorizontalAlignment.CENTER);
vp.add(panel);
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:68,代码来源:DatabaseRestore.java
示例8: renderGoodsPanel
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private void renderGoodsPanel() {
Criteria criteria = new Criteria();
criteria.addCondition(new Condition(IOrderGoods.ORDER, Condition.EQUALS, getCurState().getPkId()));
goodsLoader = new PagingListService().getLoader(ModelNames.ORDERGOODS, criteria);
final ListStore<BeanObject> store = new ListStore<BeanObject>(goodsLoader);
store.addStoreListener(new StoreListener<BeanObject>() {
public void storeDataChanged(StoreEvent<BeanObject> se) {
List<Component> items = goodsPanel.getItems();
for (Component item : items) {
item.repaint();
}
}
});
goodsToolBar = new PagingToolBar(10);
goodsToolBar.bind(goodsLoader);
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
ColumnConfig colGoodsName = new ColumnConfig(IOrderGoods.GOODSNAME, Resources.constants.Goods_name(), 100);
columns.add(colGoodsName);
ColumnConfig colGoodsSN = new ColumnConfig(IOrderGoods.GOODSSN, Resources.constants.Goods_SN(), 150);
columns.add(colGoodsSN);
ColumnConfig colGoodsPrice = new ColumnConfig(IOrderGoods.GOODSPRICE, Resources.constants.OrderDetail_price(), 100);
columns.add(colGoodsPrice);
ColumnConfig colGoodsNum = new ColumnConfig(IOrderGoods.GOODSNUMBER, Resources.constants.OrderDetail_goodsNum(), 100);
columns.add(colGoodsNum);
ColumnConfig colGoodsAttr = new ColumnConfig(IOrderGoods.GOODSATTRIBUTE, Resources.constants.OrderDetail_goodsAttr(), 200);
columns.add(colGoodsAttr);
ColumnConfig colTotalPrice = new ColumnConfig("subtotal", Resources.constants.OrderDetail_subTotalPrice(), 100);
colTotalPrice.setRenderer(new TotalPriceCellRenderer());
columns.add(colTotalPrice);
ColumnModel cm = new ColumnModel(columns);
Grid<BeanObject> grid = new Grid<BeanObject>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setAutoExpandColumn(IOrderGoods.GOODSNAME);
grid.setAutoHeight(true);
goodsPanel.setFrame(true);
goodsPanel.setLayout(new FitLayout());
goodsPanel.add(grid);
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:45,代码来源:OrderDetailPanel.java
示例9: renderGoodsPanel
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private void renderGoodsPanel() {
Criteria criteria = new Criteria();
criteria.addCondition(new Condition(IOrderGoods.ORDER, Condition.EQUALS, getCurState().getPkId()));
loader = new PagingListService().getLoader(ModelNames.ORDERGOODS, criteria);
final ListStore<BeanObject> store = new ListStore<BeanObject>(loader);
store.addStoreListener(new StoreListener<BeanObject>() {
public void storeDataChanged(StoreEvent<BeanObject> se) {
List<Component> items = goodsPanel.getItems();
for (Component item : items) {
item.repaint();
}
}
});
goodsToolBar = new PagingToolBar(10);
goodsToolBar.bind(loader);
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
ColumnConfig colGoodsName = new ColumnConfig(IOrderGoods.GOODSNAME, Resources.constants.Goods_name(), 100);
columns.add(colGoodsName);
ColumnConfig colGoodsSN = new ColumnConfig(IOrderGoods.GOODSSN, Resources.constants.Goods_SN(), 100);
columns.add(colGoodsSN);
ColumnConfig colGoodsPrice = new ColumnConfig(IOrderGoods.GOODSPRICE, Resources.constants.OrderDetail_price(), 100);
colGoodsPrice.setNumberFormat(NumberFormat.getCurrencyFormat());
//colGoodsPrice.setEditor(new CellEditor(new NumberField()));
columns.add(colGoodsPrice);
ColumnConfig colGoodsNum = new ColumnConfig(IOrderGoods.GOODSNUMBER, Resources.constants.OrderDetail_goodsNum(), 100);
//colGoodsNum.setEditor(new CellEditor(new TextField<Number>()));
columns.add(colGoodsNum);
ColumnConfig colGoodsAttr = new ColumnConfig(IOrderGoods.GOODSATTRIBUTE, Resources.constants.OrderDetail_goodsAttr(), 100);
columns.add(colGoodsAttr);
ColumnConfig colTotalPrice = new ColumnConfig("subtotal", Resources.constants.OrderDetail_subTotalPrice(), 100);
colTotalPrice.setRenderer(new TotalPriceCellRenderer());
columns.add(colTotalPrice);
ColumnConfig actcol = new ColumnConfig("Action", Resources.constants.action(), 150);
columns.add(actcol);
ColumnModel cm = new ColumnModel(columns);
Grid<BeanObject> grid = new Grid<BeanObject>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setAutoHeight(true);
grid.setAutoExpandColumn("Action");
ActionCellRenderer render = new ActionCellRenderer(grid);
ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
act.setText(Resources.constants.OrderGoods_delete());
act.setAction("deleteOrderGoods($id)");
render.addAction(act);
actcol.setRenderer(render);
goodsPanel.add(grid);
// goodsPanel.setButtonAlign(Style.HorizontalAlignment.RIGHT);
// goodsPanel.addButton(new Button(Resources.constants.OrderGoods_modifyOrderGoods(), new SelectionListener<ButtonEvent>() {
// public void componentSelected(ButtonEvent ce) {
// store.commitChanges();
// updatePrice();
// }
// }));
goodsPanel.setBottomComponent(goodsToolBar);
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:63,代码来源:OrderGoodsPanel.java
示例10: onRender
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的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
示例11: onRender
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的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
示例12: onRender
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
BasePagingLoader loader = new BonusService().getLoader(null);
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(IBonusType.TYPE_NAME, "类型名称", 100));
ColumnConfig typeCol = new ColumnConfig(IBonusType.SEND_TYPE, "发放类型", 100);
typeCol.setRenderer(new TypeCellRenderer());
columns.add(typeCol);
columns.add(new ColumnConfig(IBonusType.TYPE_MONEY, "红包金额", 80));
columns.add(new ColumnConfig(IBonusType.MIN_AMOUNT, "订单下限", 80));
columns.add(new ColumnConfig(IBonusType.NUMBER, "发放数量", 80));
columns.add(new ColumnConfig(IBonusType.USED_NUMBER, "使用数量", 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.setSelectionModel(sm);
// grid.setAutoExpandColumn("forum");
ActionCellRenderer render = new ActionCellRenderer(grid);
ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
act.setText("编辑 ");
act.setAction("changeBonus($id)");
act.setTooltip(Resources.constants.GoodsList_action_edit());
render.addAction(act);
act = new ActionCellRenderer.ActionInfo();
act.setText(" 删除");
act.setAction("deleteBonus($id)");
act.setTooltip(Resources.constants.GoodsList_action_delete());
render.addAction(act);
actcol.setRenderer(render);
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(750, 350);
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();
// }
// }));
add(panel);
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:76,代码来源:BonusListPanel.java
示例13: onRender
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
BasePagingLoader loader = new PagingListService().getLoader(ModelNames.PACK);
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(IPack.NAME, "商品包装名称", 100));
columns.add(new ColumnConfig(IPack.FEE, "费用", 80));
columns.add(new ColumnConfig(IPack.FREEMONEY, "免费额度", 80));
columns.add(new ColumnConfig(IPack.DESC, "包装描述", 300));
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.setSelectionModel(sm);
// grid.setAutoExpandColumn("forum");
ActionCellRenderer render = new ActionCellRenderer(grid);
ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
act.setText("编辑 ");
act.setAction("changePack($id)");
act.setTooltip(Resources.constants.GoodsList_action_edit());
render.addAction(act);
act = new ActionCellRenderer.ActionInfo();
act.setText(" 删除");
act.setAction("deletePack($id)");
act.setTooltip(Resources.constants.GoodsList_action_delete());
render.addAction(act);
actcol.setRenderer(render);
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(750, 350);
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();
// }
// }));
add(panel);
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:72,代码来源:PackListPanel.java
示例14: onRender
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
// final IShopServiceAsync service = getService();
// RpcProxy proxy = new RpcProxy() {
// public void load(Object loadConfig, AsyncCallback callback) {
// service.getPaymentMetaList((ListLoadConfig) loadConfig, callback);
// }
// };
// loader = new MyPagingListService().getLoader(
// ModelNames.PAYMENT_META);
// loader
// loader = new BaseListLoader(proxy);
loader.setRemoteSort(true);
// PagingToolBar toolBar = new PagingToolBar(pageSize);
// toolBar.bind(loader);
final ListStore<BeanObject> store = new ListStore<BeanObject>(loader);
store.addStoreListener(new StoreListener<BeanObject>() {
public void storeUpdate(StoreEvent<BeanObject> se) {
List<Record> changed = store.getModifiedRecords();
}
});
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
final CheckBoxSelectionModel<BeanObject> smRowSelection = new CheckBoxSelectionModel<BeanObject>();
columns.add(smRowSelection.getColumn());
columns.add(new ColumnConfig(PaymentConfigMetaForm.ID, Resources.constants
.PaymentMetaList_ID(), 50));
ColumnConfig col = new ColumnConfig(PaymentConfigMetaForm.NAME, Resources.constants
.PaymentMetaList_NAME(), 100);
col.setEditor(new CellEditor(new TextField()));
columns.add(col);
columns.add(new ColumnConfig(PaymentConfigMetaForm.DESCRIPTION, Resources.constants
.PaymentMetaList_DESC(), 200));
columns.add(new ColumnConfig(PaymentConfigMetaForm.FEE, Resources.constants
.PaymentMetaList_PAYFEE(), 50));
columns.add(new ColumnConfig(PaymentConfigMetaForm.COD, Resources.constants
.PaymentMetaList_ISCOD(), 50));
columns.add(new ColumnConfig(PaymentConfigMetaForm.ORDER, Resources.constants
.PaymentMetaList_ORDER(), 50));
ColumnConfig actcol = new ColumnConfig("Action", Resources.constants
.PaymentMetaList_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.setSelectionModel(smRowSelection);
ActionCellRenderer render = new ActionCellRenderer(grid);
actcol.setRenderer(render);
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(900, 350);
// panel.setBottomComponent(toolBar);
add(panel);
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:74,代码来源:PaymentMetaList.java
示例15: onRender
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
// loader
RpcProxy<ListLoadResult<BeanObject>> proxy = new RpcProxy<ListLoadResult<BeanObject>>() {
public void load(Object loadConfig, AsyncCallback<ListLoadResult<BeanObject>> callback) {
RemoteService.getSpecialService().getPaymentMetaList((ListLoadConfig) loadConfig, callback);
}
};
loader = new BaseListLoader<ListLoadResult<BeanObject>>(proxy);
// loader = new MyPagingListService().getLoader(
// ModelNames.PAYMENT_META);
loader.setRemoteSort(true);
final ListStore<BeanObject> store = new ListStore<BeanObject>(loader);
store.addStoreListener(new StoreListener<BeanObject>() {
public void storeUpdate(StoreEvent<BeanObject> se) {
List<Record> changed = store.getModifiedRecords();
}
});
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
final CheckBoxSelectionModel<BeanObject> smRowSelection = new CheckBoxSelectionModel<BeanObject>();
columns.add(smRowSelection.getColumn());
columns.add(new ColumnConfig(PaymentConfigMetaForm.ID, Resources.constants
.PaymentMetaList_ID(), 100));
ColumnConfig col = new ColumnConfig(PaymentConfigMetaForm.NAME, Resources.constants
.PaymentMetaList_NAME(), 100);
col.setEditor(new CellEditor(new TextField<String>()));
columns.add(col);
columns.add(new ColumnConfig(PaymentConfigMetaForm.DESCRIPTION, Resources.constants
.PaymentMetaList_DESC(), 200));
columns.add(new ColumnConfig(PaymentConfigMetaForm.FEE, Resources.constants
.PaymentMetaList_PAYFEE(), 100));
columns.add(new ColumnConfig(PaymentConfigMetaForm.COD, Resources.constants
.PaymentMetaList_ISCOD(), 100));
columns.add(new ColumnConfig(PaymentConfigMetaForm.ORDER, Resources.constants
.PaymentMetaList_ORDER(), 100));
ColumnConfig actcol = new ColumnConfig("Action", Resources.constants
.PaymentMetaList_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.setSelectionModel(smRowSelection);
grid.setAutoExpandColumn(PaymentConfigMetaForm.DESCRIPTION);
ActionCellRenderer render = new ActionCellRenderer(grid);
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);
add(panel);
Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
int w = event.getWidth() - 300;
panel.setWidth(w + "px");
}
});
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:79,代码来源:PaymentMetaListPanel.java
示例16: onRender
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
RpcProxy<ListLoadResult<ShippingConfigMetaForm>> proxy = new RpcProxy<ListLoadResult<ShippingConfigMetaForm>>() {
public void load(Object loadConfig, AsyncCallback<ListLoadResult<ShippingConfigMetaForm>> callback) {
RemoteService.getSpecialService().getCombinedShippingMetaList((ListLoadConfig) loadConfig, callback);
}
};
loader = new BaseListLoader<ListLoadResult<ShippingConfigMetaForm>>(proxy);
loader.setRemoteSort(true);
final ListStore<ShippingConfigMetaForm> store = new ListStore<ShippingConfigMetaForm>(loader);
store.addStoreListener(new StoreListener<ShippingConfigMetaForm>() {
public void storeUpdate(StoreEvent<ShippingConfigMetaForm> se) {
List<Record> changed = store.getModifiedRecords();
}
});
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
final CheckBoxSelectionModel<ShippingConfigMetaForm> smRowSelection = new CheckBoxSelectionModel<ShippingConfigMetaForm>();
columns.add(smRowSelection.getColumn());
// columns.add(new ColumnConfig(ShippingConfigMetaForm.ID, Resources.constants
// .ShippingMetaList_ID(), 50));
ColumnConfig col = new ColumnConfig(ShippingConfigMetaForm.NAME, Resources.constants
.ShippingMetaList_NAME(), 100);
col.setEditor(new CellEditor(new TextField<String>()));
columns.add(col);
columns.add(new ColumnConfig(ShippingConfigMetaForm.DESCRIPTION, Resources.constants
.ShippingMetaList_DESC(), 200));
columns.add(new ColumnConfig(ShippingConfigMetaForm.INSURE, Resources.constants
.ShippingMetaList_INSURE(), 100));
columns.add(new ColumnConfig(ShippingConfigMetaForm.SUPPORTCOD, Resources.constants
.ShippingMetaList_COD(), 100));
columns.add(new ColumnConfig(ShippingConfigMetaForm.VERSION, Resources.constants
.ShippingMetaList_VERSION(), 100));
columns.add(new ColumnConfig(ShippingConfigMetaForm.AUTHOR, Resources.constants
.ShippingMetaList_AUTHOR(), 100));
ColumnConfig actcol = new ColumnConfig("Action", Resources.constants
.ShippingMetaList_ACTION(), 200);
columns.add(actcol);
ColumnModel cm = new ColumnModel(columns);
Grid<ShippingConfigMetaForm> grid = new EditorGrid<ShippingConfigMetaForm>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setSelectionModel(smRowSelection);
grid.setAutoExpandColumn(ShippingConfigMetaForm.NAME);
ActionCellRenderer render = new ActionCellRenderer(grid);
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);
add(panel);
Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
int w = event.getWidth() - 300;
panel.setWidth(w + "px");
}
});
}
开发者ID:jbosschina,项目名称:jcommerce,代码行数:77,代码来源:ShippingMetaListPanel.java
示例17: displayTable
import com.extjs.gxt.ui.client.store.StoreEvent; //导入依赖的package包/类
private void displayTabl
|
请发表评论