PDA

View Full Version : [FIXED] rc2 - RowEditor issues (width, formated value, translation)



fother
6 Jul 2009, 5:52 AM
1 - if the column isnt editable the value should be formated..

how to reproduce.. click in one cell.. you will see that the column change and last update dont receveid the format



public void onModuleLoad() {

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
column.setEditor(new CellEditor(new TextField<String>()));
configs.add(column);

column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);

column = new ColumnConfig();
column.setId("last");
column.setHeader("Last");
column.setAlignment(HorizontalAlignment.RIGHT);
column.setWidth(75);
configs.add(column);

column = new ColumnConfig("change", "Change", 100);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setNumberFormat(NumberFormat.getCurrencyFormat());
configs.add(column);

column = new ColumnConfig("date", "Last Updated", 100);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setDateTimeFormat(DateTimeFormat.getShortDateFormat());
configs.add(column);

ListStore<Stock> store = new ListStore<Stock>();
store.add(TestData.getStocks());

ColumnModel cm = new ColumnModel(configs);

ContentPanel cp = new ContentPanel();
cp.setBodyBorder(false);
cp.setHeading("Basic Grid");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.setHeight(400);

RowEditor<Stock> rowEditor = new RowEditor<Stock>();

Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setAutoExpandColumn("name");
grid.setBorders(true);
grid.addPlugin(rowEditor);
cp.add(grid);

TabItem tabItem = new TabItem();
tabItem.add(cp, new RowData(1, 400));
tabItem.setText("Test");
tabItem.setStyleAttribute("padding", "10px");
tabItem.setScrollMode(Scroll.AUTO);
tabItem.setLayout(new RowLayout());

TabPanel tabPanel = new TabPanel();
tabPanel.add(tabItem);
tabPanel.setStyleAttribute("padding", "10px");

Viewport view = new Viewport();
view.setLayout(new FitLayout());
view.add(tabPanel);

RootPanel.get().add(view);
}



2 - row editor issue on width

how to reproduce.. click in one cell.. look attachment



public void onModuleLoad() {

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
column.setEditor(new CellEditor(new TextField<String>()));
configs.add(column);

column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);

ListStore<Stock> store = new ListStore<Stock>();
store.add(TestData.getStocks());

ColumnModel cm = new ColumnModel(configs);

ContentPanel cp = new ContentPanel();
cp.setBodyBorder(false);
cp.setHeading("Basic Grid");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.setHeight(400);

RowEditor<Stock> rowEditor = new RowEditor<Stock>();

Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setAutoExpandColumn("name");
grid.setBorders(true);
grid.addPlugin(rowEditor);
cp.add(grid);

TabItem tabItem = new TabItem();
tabItem.add(cp, new RowData(1, 400));
tabItem.setText("Test");
tabItem.setStyleAttribute("padding", "10px");
tabItem.setScrollMode(Scroll.AUTO);
tabItem.setLayout(new RowLayout());

TabPanel tabPanel = new TabPanel();
tabPanel.add(tabItem);
tabPanel.setStyleAttribute("padding", "10px");

Viewport view = new Viewport();
view.setLayout(new FitLayout());
view.add(tabPanel);

RootPanel.get().add(view);
}


I'm using this recomendation to create the layouts http://www.extjs.com/forum/showthread.php?t=70885

tested on hosted mode win vista

fother
6 Jul 2009, 6:00 AM
translate to pt_BR



rowEditor_cancelText=Cancelar
rowEditor_saveText=Salvar




public void startEditing(int rowIndex, boolean doFocus) {
if (editing && isDirty()) {
showTooltip("You need to commit or cancel your changes");
return;
}

.....

You need to commit or cancel your changes = Você precisar salvar ou cancelar suas alterações



protected void showTooltip(String msg) {

if (tooltip == null) {
ToolTipConfig config = new ToolTipConfig();
config.setAutoHide(false);
config.setMouseOffset(new int[] {25, 0});
config.setTitle("Errors");


Errors = Erros

:)

sven
6 Jul 2009, 6:40 AM
Fixed the one real issue (the wrong button position) in svn.

fother
6 Jul 2009, 6:43 AM
the item 2?

fother
24 Jul 2009, 6:30 AM
this problem appears again in gxt 2.0.1

test in hosted mode win vista - updated the css and the jar



public void onModuleLoad() {

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
column.setEditor(new CellEditor(new TextField<String>()));
configs.add(column);

column = new ColumnConfig();
column.setId("symbol");
column.setHeader("Symbol");
column.setWidth(100);
configs.add(column);

ListStore<Stock> store = new ListStore<Stock>();
store.add(TestData.getStocks());

ColumnModel cm = new ColumnModel(configs);

ContentPanel cp = new ContentPanel();
cp.setBodyBorder(false);
cp.setHeading("Basic Grid");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.setHeight(400);

RowEditor<Stock> rowEditor = new RowEditor<Stock>();

Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setAutoExpandColumn("name");
grid.setBorders(true);
grid.addPlugin(rowEditor);
cp.add(grid);

TabItem tabItem = new TabItem();
tabItem.add(cp, new RowData(1, 400));
tabItem.setText("Test");
tabItem.setStyleAttribute("padding", "10px");
tabItem.setScrollMode(Scroll.AUTO);
tabItem.setLayout(new RowLayout());

TabPanel tabPanel = new TabPanel();
tabPanel.add(tabItem);
tabPanel.setStyleAttribute("padding", "10px");

Viewport view = new Viewport();
view.setLayout(new FitLayout());
view.add(tabPanel);

RootPanel.get().add(view);
}

sven
24 Jul 2009, 11:00 AM
Fixed in SVN.