Is there a nice way to add text box widgets to the column headers in a Grid? I'd like to add simple filtering capabilities to a grid.
Printable View
Is there a nice way to add text box widgets to the column headers in a Grid? I'd like to add simple filtering capabilities to a grid.
Even i need the similiar approach in my application. If we get the sample code, it will be more benifical.
One way that might work is the following:
When creating the ColumnConfig for a specific column, it is possible to pass a SafeHtml instance instead of a String, in order to describe the header.
So creating a class and overriding the asString()-method of SafeHtml provides a way to add widgets to a column header.
An example:
This should also work with another widget like an input field.Code:class CustomHeaderHtml implements SafeHtml {
@Override
public String asString() {
Image customHeaderImage = new Image("...");
String headerHtml = "<div style=\"text-align:center;\">" + customHeaderImage.toString() + "</div>";
return headerHtml;
}
}
Maybe there are some other ways to accomplish this. As I'm new to GXT too, I don't know them yet.
So I hope this might help you in some way.
Greetz
Stefan