rickilama54 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

TreeGridField.setHeaderBaseStyle ignored until the first mouse-over #314

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When you compile following you can see (using a DOM-inspector) that until
the first mouse-over the field has 'headerButton' class (instead of what
has been set setHeaderBaseStyle)...

(My goal here is to turn the header of the remove-column into an "add
record" button. If anyone knew better way to acheive this tell me PLZ!)

public void onModuleLoad()
{
  ListGrid grid = new ListGrid();
  grid.setSelectionType(SelectionStyle.SINGLE);
  grid.setCanRemoveRecords(true);

  // define fields {

  TreeGridField idField = new TreeGridField("id");
  TreeGridField nameField = new TreeGridField("name", 150);
  TreeGridField addRemoveField = new TreeGridField("addRemove", 25);
  addRemoveField.setIsRemoveField(true);
  addRemoveField.setHeaderBaseStyle("addButton");
  grid.addHeaderClickHandler(new HeaderClickHandler()
    {
      public void onHeaderClick(HeaderClickEvent event)
      {
        // if this is the addRemove field
        // delete currently selected record
      }
    });
  grid.setFields(idField, nameField, addRemoveField);

  grid.draw();
}

Original issue reported on code.google.com by jaroslav...@gmail.com on 9 Sep 2009 at 5:43

GoogleCodeExporter commented 8 years ago
err, obviously the onHeaderClick would not delete currently selected record, but
rather call startEditingNew()

Original comment by jaroslav...@gmail.com on 9 Sep 2009 at 5:56

GoogleCodeExporter commented 8 years ago
Showcase:
http://testcase.acolyte.cz/TestCase.html

The upper right button should have a green plus sign as a background-image. But 
until
you move mouse over it the default background-image is displayed, because the 
custom
className does not get set.

The Eclipse GWT project is in the attachment.

Original comment by jaroslav...@gmail.com on 12 Sep 2009 at 8:03

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Fixed in SVN.

Original comment by sanjiv.j...@gmail.com on 1 Feb 2010 at 11:02