PDA

View Full Version : How to call a page in navigation Panel from a Grid column as a hyperlink or button



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,

Arno.Nyhm
13 Aug 2009, 3:56 AM
is your question who to create an other (gxt) tab with gxt widgets in your tabpanel?

then look into the code of the navigation panel how the tabs are created.
you dont need to create a hyperlink etc.

shajeerkt
15 Aug 2009, 2:57 AM
No,

i want like a hyperlink in a gridcell which will route me to a page in the Navigation pane .
Any help will be appreciated ..