On Wed, Jul 28, 2010 at 11:44, Marta Smith <[email protected]> wrote:

> Hi Derell,
>
> thank you for your response! We did extend the Cellrenderer class, and we
> found a really easy way to add a tooltip. We added a "title" tag to display
> the CellInfo content. The only problem is that when the row is focused the
> title gets overridden by the FocusIndicator layer. I know I can disable it,
> but this is a dynamic table and the focusIndicator is very useful for the
> user to see what cell they are selecting for edit in the table.
> I looked to see if there is a way to set the cellIndicator from my table,
> to somehow get the title content from the cellrenderer, but the
> focusIndicator doesn't know anything about the cellData. am I correct? Other
> than using setShowCellFocusIndicator(
> false) I could not find a solution to this problem. Do you know how I can
> get around this issue?
>

That's an interesting and easy solution. To solve your problem, you can
probably do something like the following:

Subclass qx.ui.table.pane.FocusIndicator and override the constructor and
moveToCell method:

construct : function(scroller)
{
  this.base(arguments, scroller);
  this.__scroller = scroller;
}

moveToCell : function(col, row)
{
  this.base(arguments, col, row);

  // Get the table model and the data in the cell
  var tableModel = this.__scroller.getTable().getTableModel();

  // Retrieve the data for the focused cell
  var data = tableModel.getValue(col, row);

  // Use this data somehow in this focus indicator
}

Then to be able to use this custom focus indicator, you'll have to override
the scroller as well so that the focus indicator child uses your new class:

_createChildControlImpl : function(id)
{
  var control;

  switch(id)
  {
    case "focus-indicator":
    control = new custom.FocusIndicator(this); // THIS IS YOUR FOCUS
INDICATOR SUBCLASS
    control.setUserBounds(0, 0, 0, 0);
    control.setZIndex(1000);
    control.addListener("mouseup", this._onMouseupFocusIndicator, this);
    this.getPaneClipper().add(control);
    control.show();             // must be active for editor to operate
    control.setDecorator(null); // it can be initially invisible, though.
    break;
  }

  return control || this.base(arguments, id);
}

and then arrange to use the new scroller:

var custom =
{
  tablePaneScroller : function(obj)
  {
    return new custom.Scroller;  // THIS IS YOUR SCROLLER SUBCLASS
  }
}

var table = new qx.ui.table.Table(tableModel, custom);

That "should" do it for you.

Derrell
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to