本文整理汇总了Java中com.extjs.gxt.ui.client.widget.grid.ColumnData类的典型用法代码示例。如果您正苦于以下问题:Java ColumnData类的具体用法?Java ColumnData怎么用?Java ColumnData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColumnData类属于com.extjs.gxt.ui.client.widget.grid包,在下文中一共展示了ColumnData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRenderer
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
@Override
public void setRenderer(GridCellRenderer renderer) {
this.specificRender = renderer;
super.setRenderer(new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store) {
String text = specificRender.render(model, property, config, rowIndex, colIndex, store);
config.css = "x-grid3-popup-col-td";
if (permissions.getCurrentState().equals(CMDBPermissions.PermissionState.READONLY)) {
return "<div class='x-grid3-popup-col x-grid3-popup-" + getId() + "'>" +
text +
"</div>";
} else {
return(text);
}
}
});
}
示例2: init
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
protected void init() {
setRenderer(new GridCellRenderer() {
public String render(ModelData model, String property, ColumnData config, int rowIndex,
int colIndex, ListStore store) {
boolean v = getValue(model, property);
String on = v ? "-on" : "";
config.css = "x-grid3-check-col-td";
if (readonly || !isModelEditable(model, property)) {
return "<div class='x-grid3-check-ro-col" + on + " x-grid3-cc-" +getId() + "'> </div>";
}
return "<div class='x-grid3-check-col" + on + " x-grid3-cc-" +getId() + "'> </div>";
}
});
}
示例3: init
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
protected void init() {
setRenderer(new GridCellRenderer() {
public String render(ModelData model, String property, ColumnData config, int rowIndex,
int colIndex, ListStore store) {
String value = getStringValue(model, property);
config.css = "x-grid3-url-col-td";
if (readonly) {
return "<div class='x-grid3-url-col x-grid3-url-" + getId() + "'>" +
"<a href='javascript:void()'>" + value + "</a>" +
"</div>";
} else {
return(value);
}
}
});
}
示例4: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
public Object render(final RuleModel model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<RuleModel> store, Grid<RuleModel> grid) {
if (!init) {
init = true;
grid.addListener(Events.ColumnResize, new ResizeListener(20));
}
LabelField field = new LabelField();
field.setId(fieldId);
field.setName(fieldId);
field.setEmptyText("*");
field.setFieldLabel(BeanKeyValue.NAME.getValue());
field.setValue(BeanKeyValue.NAME.getValue());
field.setReadOnly(true);
// field.setWidth(initialWidth - 10);
field.setAutoWidth(true);
field.show();
setFieldValue(model, field);
return field;
}
示例5: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Object render(final ProjectFundingDTO model, final String property, final ColumnData config, final int rowIndex, final int colIndex,
final ListStore<ProjectFundingDTO> store, final Grid<ProjectFundingDTO> grid) {
// Creates the button with its icon.
final PushButton editButton = new PushButton(IconImageBundle.ICONS.editLinkedProject().createImage());
editButton.setStylePrimaryName(STYLE_EDIT_BUTTON);
// Sets the button click handler.
editButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
view.getPresenterHandler().onLinkedProjectEditClickEvent(model, projectType);
}
});
// Returns this button.
return editButton;
}
示例6: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
@Override
public Object render(PivotGridPanel.PivotTableRow model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<PivotGridPanel.PivotTableRow> store, Grid<PivotGridPanel.PivotTableRow> grid) {
Double value = model.get(property);
if(value == null) {
return "";
} else {
String formattedValue = formatValue(model.getRowAxis(), value);
if(model.getRowAxis().isTotal()) {
return "<span class='" + PivotResources.INSTANCE.css().totalCell() + "'>" +
formattedValue + "</span>";
} else {
return formattedValue;
}
}
}
示例7: generatePossibleDuplicatesGrid
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
private Grid<ContactDTO> generatePossibleDuplicatesGrid() {
ColumnConfig nameColumn = new ColumnConfig(ContactDTO.FULLNAME, I18N.CONSTANTS.fullName(), 250);
ColumnConfig emailColumn = new ColumnConfig(ContactDTO.EMAIL, I18N.CONSTANTS.email(), 250);
ColumnConfig actionsColumn = new ColumnConfig();
actionsColumn.setWidth(100);
actionsColumn.setRenderer(new GridCellRenderer<ContactDTO>() {
@Override
public Object render(final ContactDTO contact, String property, ColumnData config, int rowIndex, int colIndex, ListStore store, Grid grid) {
Button button = Forms.button(I18N.CONSTANTS.dedupeContactUpdateButton());
button.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
cardLayout.setActiveItem(secondStepContainer);
secondStepHandler.initialize(contact.getId(), duplicatedPropertiesGrid.getStore());
selectedContact = contact;
}
});
return button;
}
});
ColumnModel columnModel = new ColumnModel(Arrays.asList(nameColumn, emailColumn, actionsColumn));
return new Grid<ContactDTO>(new ListStore<ContactDTO>(), columnModel);
}
示例8: getGridCellRenderer
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
private GridCellRenderer<ModelData> getGridCellRenderer(){
GridCellRenderer<ModelData> r = new GridCellRenderer<ModelData>(){
@Override public Object render(ModelData model, String property,ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store, Grid<ModelData> grid) {
if(model.get(property).toString().equals("true")){
config.style = "background-image: url("+ GWT.getHostPageBaseURL().toString() + "resources/icons/add.gif) !important; background-repeat: no-repeat;";
}else{
config.style = "background-color: white;";
}
return "";
}
};
return r;
}
示例9: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
@Override
public Object render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore store, Grid grid) {
/*
if(Integer.parseInt(property) <= holidays.size()){
if(holidays.get(Integer.parseInt(property))){
config.css = "x-treegrid-column-holiday";
}
}
*/
config.css = "x-treegrid-column-holiday";
if(model.get(property) == null){
return "<span style='color: green'></span>";
} else{
return "<span style='color: green'>" + model.get(property) + "</span>";
}
}
示例10: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
public String render(BeanObject model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<BeanObject> store) {
String booleanValue = (String) model.get(property).toString();
StringBuffer sb = new StringBuffer();
ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
if(booleanValue.equals("true")){
act.setText(isTruthStr);
}else if(booleanValue.equals("false")){
act.setText(isFailureStr);
}
if (act.getText() != null && act.getText().trim().length() > 0) {
sb.append(act.getText());
}
return sb.toString();
}
示例11: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
public String render(BeanObject model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<BeanObject> store) {
String booleanValue = (String) model.get(property).toString();
StringBuffer sb = new StringBuffer();
ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
if(booleanValue.equals("1")){
act.setText(isTruthStr);
}else if(booleanValue.equals("0")){
act.setText(isFailureStr);
}
if (act.getText() != null && act.getText().trim().length() > 0) {
sb.append(act.getText());
}
return sb.toString();
}
示例12: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
public String render(BeanObject model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<BeanObject> store) {
String booleanValue = (String) model.get(property).toString();
StringBuffer sb = new StringBuffer();
ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
if(booleanValue.equals("1")){
act.setText(isTruthStr);
}else if(booleanValue.equals("0")){
act.setText(isFailureStr);
}else if(booleanValue.equals("true")) {
act.setText(isTruthStr);
}else if(booleanValue.equals("false")) {
act.setText(isFailureStr);
}
if (act.getText() != null && act.getText().trim().length() > 0) {
sb.append(act.getText());
}
return sb.toString();
}
示例13: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
public Object render(BeanObject model, String property, ColumnData config,
final int rowIndex, final int colIndex, ListStore<BeanObject> store,
Grid<BeanObject> grid) {
int type = (Integer)model.get(IBonusType.SEND_TYPE);
if (type == IBonusType.SEND_BY_USER) {
return "按用户发放";
} else if (type == IBonusType.SEND_BY_GOODS) {
return "按商品发放";
} else if (type == IBonusType.SEND_BY_ORDER) {
return "按订单金额发放";
} else if (type == IBonusType.SEND_BY_PRINT) {
return "线下发放的红包";
}
throw new RuntimeException("Unknown send type: "+type);
}
示例14: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
public Object render(BeanObject model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<BeanObject> store, Grid<BeanObject> grid) {
// BeanObject bean = grid.getSelectionModel().getSelectedItem();
// String time = bean.getString(IFavourableActivity.START_TIME);
// System.out.println(time);
ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
System.out.println(act.getText() + " - " + act.getAction());
String tmpAct = act.getText();
// Long time = Long.parseLong(tmpAct);
Date date = new Date();
// act.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date));
act.setText(date + "");
return act.getText();
}
示例15: render
import com.extjs.gxt.ui.client.widget.grid.ColumnData; //导入依赖的package包/类
public Object render(BeanObject model, String property, ColumnData config, final int rowIndex, final int colIndex,
ListStore<BeanObject> store, Grid<BeanObject> grid) {
// public String render(BeanObject model, String property, ColumnData config,
// final int rowIndex, final int colIndex, ListStore<BeanObject> store) {
final IShopServiceAsync service = (IShopServiceAsync)Registry.get("service");
Long id = (Long) model.get(property);
service.getBean(modelName, id, new AsyncCallback<BeanObject>() {
public synchronized void onSuccess(BeanObject props) {
String value = props.get(propName);
Element el = view.getCell(rowIndex, colIndex);
String text = el.getInnerHTML();
if (text.indexOf(">") > 0 && text.indexOf("</") > 0) {
text = text.substring(0, text.indexOf(">") + 1) + value + text.substring(text.indexOf("</"));
}
el.setInnerHTML(text);
}
public synchronized void onFailure(Throwable caught) {
System.out.println("getBean onFailure("+caught);
}
});
return "waiting";
}