shajeerkt
11 Aug 2009, 11:41 PM
Dear All,
How can i call a page which is in the navigation pane from a grid column as a hyperlink or a button.
For example, what i need is from this page(http://extjs.com/examples/#widgetrenderergrid) by clicking one of the button or link in the grid i should open another grid(http://extjs.com/examples/#paging)
this is what i had done.
GridCellRenderer<TestData> buttonRenderer = new GridCellRenderer<TestData>() {
private boolean init;
public Object render(final TestData model, String property, ColumnData config, final int rowIndex,
final int colIndex, ListStore<TestData> store, Grid<TestData> grid) {
if (!init) {
init = true;
grid.addListener(Events.ColumnResize, new Listener<GridEvent<TestData>>() {
public void handleEvent(GridEvent<TestData> be) {
for (int i = 0; i < be.getGrid().getStore().getCount(); i++) {
((Button) be.getGrid().getView().getWidget(i, be.getColIndex())).setWidth(be.getWidth() - 10);
}
}
});
}
final StringBuffer str = new StringBuffer();
str.append("<a href=");
str.append("\"");
str.append("http://www.google.com");
str.append("\"");
str.append(">");
str.append(model.getDsl_type());
str.append("</a>");
final Html html = new Html(str.toString());
return html;
}
};
column = new ColumnConfig();
column.setId("dsl_type");
column.setHeader("DSL Type");
column.setWidth(100);
column.setRenderer(buttonRenderer);
configs.add(column);
In my code i had given to open google.com . Its working but opening in another page .
So what i need is want to open another grid page from the navigation pane when i click a link on the grid cell , as a normal click in the navigation pane.
Hope you understand my question .
Sorry for my bad English .
Thanks and regards,
How can i call a page which is in the navigation pane from a grid column as a hyperlink or a button.
For example, what i need is from this page(http://extjs.com/examples/#widgetrenderergrid) by clicking one of the button or link in the grid i should open another grid(http://extjs.com/examples/#paging)
this is what i had done.
GridCellRenderer<TestData> buttonRenderer = new GridCellRenderer<TestData>() {
private boolean init;
public Object render(final TestData model, String property, ColumnData config, final int rowIndex,
final int colIndex, ListStore<TestData> store, Grid<TestData> grid) {
if (!init) {
init = true;
grid.addListener(Events.ColumnResize, new Listener<GridEvent<TestData>>() {
public void handleEvent(GridEvent<TestData> be) {
for (int i = 0; i < be.getGrid().getStore().getCount(); i++) {
((Button) be.getGrid().getView().getWidget(i, be.getColIndex())).setWidth(be.getWidth() - 10);
}
}
});
}
final StringBuffer str = new StringBuffer();
str.append("<a href=");
str.append("\"");
str.append("http://www.google.com");
str.append("\"");
str.append(">");
str.append(model.getDsl_type());
str.append("</a>");
final Html html = new Html(str.toString());
return html;
}
};
column = new ColumnConfig();
column.setId("dsl_type");
column.setHeader("DSL Type");
column.setWidth(100);
column.setRenderer(buttonRenderer);
configs.add(column);
In my code i had given to open google.com . Its working but opening in another page .
So what i need is want to open another grid page from the navigation pane when i click a link on the grid cell , as a normal click in the navigation pane.
Hope you understand my question .
Sorry for my bad English .
Thanks and regards,