Loading ...
Sorry, an error occurred while loading the content.

Inline cell editor position

Expand Messages
  • vino_gallantguy
    Hi , I have a datatable with textbox cell editor. Data in the cell sometimes spans over multiple lines, and when i click on it the textbox cell editor pops up
    Message 1 of 3 , Dec 16, 2009
    • 0 Attachment
      Hi ,

      I have a datatable with textbox cell editor. Data in the cell sometimes spans over multiple lines, and when i click on it the textbox cell editor pops up right at the top of the cell,which looks real odd.

      I'm trying to figure out a way to make the editor pop up right at the center of the cell. Can anyone suggest how this can be done ?

      I tried padding, but that will not work as the size of my cell varies dynamically based on the data.

      Please suggest.


      Regs,
      Vino
    • Satyam
      The editorShowEvent will fire after the editor is shown and it provides you a reference to the cell editor.
      Message 2 of 3 , Dec 16, 2009
      • 0 Attachment
        The editorShowEvent will fire after the editor is shown and it provides
        you a reference to the cell editor.

        http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html#event_editorShowEvent

        You would then need to find out if the editor is the one that
        corresponds to the column you want:

        http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html#event_editorShowEvent

        and if so, adjust the height of the container:

        http://developer.yahoo.com/yui/docs/YAHOO.widget.BaseCellEditor.html#method_getContainerEl

        to that of the cell:

        http://developer.yahoo.com/yui/docs/YAHOO.widget.BaseCellEditor.html#method_getTdEl

        You can also adjust the size of the input box:

        http://developer.yahoo.com/yui/docs/YAHOO.widget.TextboxCellEditor.html#property_textbox

        or, if you are feeling courageous, redefine method move to do it all.

        http://developer.yahoo.com/yui/docs/YAHOO.widget.TextboxCellEditor.html#method_move

        Satyam

        vino_gallantguy escribió:
        > Hi ,
        >
        > I have a datatable with textbox cell editor. Data in the cell sometimes spans over multiple lines, and when i click on it the textbox cell editor pops up right at the top of the cell,which looks real odd.
        >
        > I'm trying to figure out a way to make the editor pop up right at the center of the cell. Can anyone suggest how this can be done ?
        >
        > I tried padding, but that will not work as the size of my cell varies dynamically based on the data.
        >
        > Please suggest.
        >
        >
        > Regs,
        > Vino
        >
        >
        >
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 9.0.716 / Virus Database: 270.14.109/2567 - Release Date: 12/15/09 20:58:00
        >
        >
      • vino ben
        Thanks very much Satyam. Your inputs have saved my day. This is what I have done. In the move() function - I get the height of the td element and calculate the
        Message 3 of 3 , Dec 18, 2009
        • 0 Attachment

          Thanks very much Satyam. Your inputs have saved my day.

          This is what I have done.

          In the move() function - I get the height of the td element and calculate the Y for the container top and set it 
          move : function() {
                          var elTd = this.getTdEl();
            this.textbox.style.width = this.getTdEl().offsetWidth + "px";
          YAHOO.widget.TextAutoComplete.superclass.move.call(this);
                  
                 var y = YAHOO.util.Dom.getY(elTd);
                  this.getContainerEl().style.top = (y+ (elTd.offsetHeight/2) - 11.5) + "px";

          }
          Regards,
          Vinoth

          From: Satyam <satyam@...>
          To: ydn-javascript@yahoogroups.com
          Sent: Wed, December 16, 2009 10:04:26 PM
          Subject: Re: [ydn-javascript] Inline cell editor position

           

          The editorShowEvent will fire after the editor is shown and it provides
          you a reference to the cell editor.

          http://developer. yahoo.com/ yui/docs/ YAHOO.widget. DataTable. html#event_ editorShowEvent

          You would then need to find out if the editor is the one that
          corresponds to the column you want:

          http://developer. yahoo.com/ yui/docs/ YAHOO.widget. DataTable. html#event_ editorShowEvent

          and if so, adjust the height of the container:

          http://developer. yahoo.com/ yui/docs/ YAHOO.widget. BaseCellEditor. html#method_ getContainerEl

          to that of the cell:

          http://developer. yahoo.com/ yui/docs/ YAHOO.widget. BaseCellEditor. html#method_ getTdEl

          You can also adjust the size of the input box:

          http://developer. yahoo.com/ yui/docs/ YAHOO.widget. TextboxCellEdito r.html#property_ textbox

          or, if you are feeling courageous, redefine method move to do it all.

          http://developer. yahoo.com/ yui/docs/ YAHOO.widget. TextboxCellEdito r.html#method_ move

          Satyam

          vino_gallantguy escribió:

          > Hi ,
          >
          > I have a datatable with textbox cell editor. Data in the cell sometimes spans over multiple lines, and when i click on it the textbox cell editor pops up right at the top of the cell,which looks real odd.
          >
          > I'm trying to figure out a way to make the editor pop up right at the center of the cell. Can anyone suggest how this can be done ?
          >
          > I tried padding, but that will not work as the size of my cell varies dynamically based on the data.
          >
          > Please suggest.
          >
          >
          > Regs,
          > Vino
          >
          >
          >
          >
          >
          >
          > ------------ --------- --------- ------
          >
          > Yahoo! Groups Links
          >
          >
          >
          > ------------ --------- --------- --------- --------- --------- -
          >
          >
          > No virus found in this incoming message.
          > Checked by AVG - www.avg.com
          > Version: 9.0.716 / Virus Database: 270.14.109/2567 - Release Date: 12/15/09 20:58:00
          >
          >


        Your message has been successfully submitted and would be delivered to recipients shortly.