Image update problem in table header cell

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Image update problem in table header cell

kirra5
Hi

I am trying to add a new image to the header, under the sort image that is already implemented.
But once the header is rendered and the icon is visible, how can I make it disappear or make it visible again? The header won't update even if I exclude the icon. What am I doing wrong?

My HeaderCell class:

qx.Class.define("myproject.HeaderCell",
{
  extend : qx.ui.table.headerrenderer.HeaderCell,

  construct : function()
  {
    this.base(arguments);

    var gridLayout = new qx.ui.layout.Grid();
    gridLayout.setColumnFlex(0, 1);
    this.iconContainer = new qx.ui.container.Composite(gridLayout);
    this._add(this.iconContainer, {row: 0, column: 2});
    var iconSort = this.getChildControl("sort-icon");
    this.iconContainer.add(iconSort, {row: 1, column: 1});  
    this._createChildControl("buttonSearch");
  },

  properties:
  {
    buttonSort :
    {
      init : null,
      nullable : true
    }
  },

  members :
  {
    iconContainer: null,
   
    _createChildControlImpl : function(id, hash)
    {
      var control;

      switch(id)
      {      
        case "buttonSearch":
          control = new qx.ui.basic.Image("myproject/icon.png");
          this.iconContainer._add(control, {row: 2, column: 1});
          break;
      }

      return control || this.base(arguments, id);
    },
   
    setButtonSearchVisibility: function(visible){
        if(visible){
           this._showChildControl("buttonSearch");
        }else{
            this._excludeChildControl("buttonSearch");
        }        
    }

  }

});


Reply | Threaded
Open this post in threaded view
|

Re: Image update problem in table header cell

Aleksandar Josipovic - Vertec AG
Hi kirra5

How are you calling setButtonSearchVisibility? The methodname suggests that it would expect a string like "visible" or "excluded" instead of a boolean.
By only checking if the argument is truthy, passing "visible" or "excluded" would always show the icon.

-----Ursprüngliche Nachricht-----
Von: kirra5 [mailto:[hidden email]]
Gesendet: Freitag, 30. Januar 2015 15:29
An: [hidden email]
Betreff: [qooxdoo-devel] Image update problem in table header cell

Hi

I am trying to add a new image to the header, under the sort image that is already implemented.
But once the header is rendered and the icon is visible, how can I make it disappear or make it visible again? The header won't update even if I exclude the icon. What am I doing wrong?

My HeaderCell class:

qx.Class.define("myproject.HeaderCell",
{
  extend : qx.ui.table.headerrenderer.HeaderCell,

  construct : function()
  {
    this.base(arguments);

    var gridLayout = new qx.ui.layout.Grid();
    gridLayout.setColumnFlex(0, 1);
    this.iconContainer = new qx.ui.container.Composite(gridLayout);
    this._add(this.iconContainer, {row: 0, column: 2});
    var iconSort = this.getChildControl("sort-icon");
    this.iconContainer.add(iconSort, {row: 1, column: 1});  
    this._createChildControl("buttonSearch");
  },

  properties:
  {
    buttonSort :
    {
      init : null,
      nullable : true
    }
  },

  members :
  {
    iconContainer: null,
   
    _createChildControlImpl : function(id, hash)
    {
      var control;

      switch(id)
      {      
        case "buttonSearch":
          control = new qx.ui.basic.Image("myproject/icon.png");
          this.iconContainer._add(control, {row: 2, column: 1});
          break;
      }

      return control || this.base(arguments, id);
    },
   
    setButtonSearchVisibility: function(visible){
        if(visible){
           this._showChildControl("buttonSearch");
        }else{
            this._excludeChildControl("buttonSearch");
        }        
    }

  }

});






--
View this message in context: http://qooxdoo.678.n2.nabble.com/Image-update-problem-in-table-header-cell-tp7586746.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Image update problem in table header cell

kirra5
This post was updated on .
Hi

I call it like this:

this.setButtonSearchVisibility(true);

but "this._showChildControl("buttonSearch")" and "this._excludeChildControl("buttonSearch")" have no effect.

I even tried this, but it was not working either:

this.getChildControl("buttonSearch").setVisibility("visible");
and
this.getChildControl("buttonSearch").setVisibility("excluded");


Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Image update problem in table header cell

Peter Schneider
Hi, in case you haven't come to a solution on your side:

In the provided playground code you can see that (and how) it works.

The 'myproject.Header' class just stores the reference to a created HeaderCell
and forwards the set 'setButtonSearchVisibility' functionality.

I hope you see what I've done.

/Peter

--


** Unsere Veranstaltungen 2015

transport logistic München Halle B2, Stand 317/518 5.5.-8.5.2015
MöLo Kassel 18.6.-20.6.2015
Postexpo Paris 29.9.-1.10.2015

** NEU: Unser BLOG

telematics-magazine.com
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Playground.js.txt (4K) Download Attachment