Results 1 to 3 of 3

Thread: Adding widgets to Grid column headers

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2008
    Posts
    73
    Vote Rating
    5
      0  

    Default Unanswered: Adding widgets to Grid column headers

    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.

  2. #2
    Sencha User
    Join Date
    Nov 2012
    Location
    India
    Posts
    14
    Vote Rating
    0
      0  

    Default

    Even i need the similiar approach in my application. If we get the sample code, it will be more benifical.

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    13
    Vote Rating
    0
      0  

    Default

    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:

    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;
                }
            }
    This should also work with another widget like an input field.

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •