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

52067Re: [ydn-javascript] Re: DataTable Editor using the TAB key to move to the next cell

Expand Messages
  • George Papaioannou
    Nov 4, 2009
      Satyam you can download a working example at


      This sample implicate DataBase retriving data. You can target your attention at the DataEdit.doBeforeShowCellEditor function, since if you hard code the data of the custom drop down menu  like below,  instead of retriving them from the DB, then it works. 

      oEditor.dropdownOptions = YAHOO.lang.JSON.parse('[{"label": "Germany", "value": "97"}, {"label": "Italy", "value": "101"}]');
      oEditor.setOptions();


      But if you use asyncRequest and set the data inside the success function, then it loses the focus.

      Regards,
      George

      --- Στις Τρίτ., 03/11/09, ο/η Satyam <satyam@...> έγραψε:

      Από: Satyam <satyam@...>
      Θέμα: Re: [ydn-javascript] Re: DataTable Editor using the TAB key to move to the next cell
      Προς: ydn-javascript@yahoogroups.com
      Ημερομηνία: Τρίτη, 3 Νοέμβριος 2009, 20:01

       



      George Papaioannou escribió:
      >
      >
      > Satyam the custom drop down menus still does not have the focus. Any
      > recommendation ?
      >
      Not really, do you have a working sample I can take a look at?
      >
      >
      > Is there anyway to make (select) by default the string inside the
      > inline cell editor when it opens ? In Firefox this is by default but
      > in Chrome is the text is unselected.
      >
      The code for method focus of TextboxCellEditor does it, or so it would seem:

      /**
      * Sets focus in TextboxCellEditor.
      *
      * @method focus
      */
      focus : function() {
      // Bug 2303181, Bug 2263600
      this.getDataTable( )._focusEl( this.textbox) ;
      this.textbox. select();
      },

      If it doesn't work consistently across browsers, I'm sure the YUI team
      would like to know. Chrome is not supported but is based on the same
      WebKit that Safari is, which is supported, so they usually behave alike.

      Satyam
      >
      > Regards,
      > George
      >
      > --- ???? *???., 28/10/09, ?/? Satyam /<satyam@satyam. com.ar>/* ??????:
      >
      >
      > ???: Satyam <satyam@satyam. com.ar>
      > ????: Re: [ydn-javascript] Re: DataTable Editor using the TAB key
      > to move to the next cell
      > ????: ydn-javascript@ yahoogroups. com
      > ??????????: ???????, 28 ????????? 2009, 20:15
      >
      > I forgot to call stopEvent when the key is one I want to deal
      > with. This
      > was causing some issues, like the cell editor for the radio
      > buttons now
      > showing up. I fixed the example. Perhaps it caused problems with your
      > dropdown as well since the keydown event kept bubbling.
      >
      > Satyam
      >
      > George Papaioannou escribió:
      > >
      > >
      > > Thank you Satyam, it worked without problems to me.
      > >
      > > The only situation I have is with my custom drop down menus
      > insde the
      > > table (the one that the content are filled on the air with the
      > > doBeforeShowCellEdi tor event). It loses the focus ie does not is
      > > selected by default the drop down object itself, so the TAB
      > moves on,
      > > to the next object of the layout and not to the next cell as it
      > would be.
      > >
      > > I tryied to use the oEditor.focus( ) inside doBeforeShowCellEdi tor
      > > without success like below
      > >
      > > oEditor.dropdownOpt ions = r.DataSet.items; //setting the items
      > > oEditor.setOptions( );
      > > oEditor.focus( ); //keep focus to the drop down object itself
      > >
      > >
      > > Do you have any idea ?
      > >
      > > Regards,
      > > George
      > >
      > > --- ???? *???., 24/10/09, ?/? Satyam /<satyam@satyam. com.ar
      > </mc/compose? to=satyam% 40satyam. com.ar>>/ * ??????:
      > >
      > >
      > > ???: Satyam <satyam@satyam. com.ar
      > </mc/compose? to=satyam% 40satyam. com.ar>>
      > > ????: Re: [ydn-javascript] Re: DataTable Editor using the TAB key
      > > to move to the next cell
      > > ????: ydn-javascript@ yahoogroups. com
      > </mc/compose? to=ydn-javascrip t%40yahoogroups. com>
      > > ??????????: ???????, 24 ????????? 2009, 18:52
      > >
      > > I guess I'll have to figure out something, there is too many people
      > > asking for this. See:
      > >
      > > http://www.satyam. com.ar/yui/ 2.7.0/keynav. html
      > > <http://www.satyam. com.ar/yui/ 2.7.0/keynav. html
      > <http://www.satyam. com.ar/yui/ 2.7.0/keynav. html>>
      > >
      > > It is just a first attempt, I don't know why it does funny things,
      > > like
      > > the tab order seems to be a little funny and some editors won't
      > > pop up.
      > > As if the getNextTdEl and get previous are not correct. I'll have to
      > > find out about that.
      > >
      > > Satyam
      > >
      > > George Papaioannou escribió:
      > > >
      > > >
      > > > Hi,
      > > >
      > > > Satyam, do you have any good idea of how to do this ?
      > > >
      > > > Regards,
      > > >
      > > > --- ???? *????., 19/10/09, ?/? Matt /<matt@lamplightdb. co.uk
      > > </mc/compose? to=matt%40lampli ghtdb.co. uk>>/* ??????:
      > > >
      > > >
      > > > ???: Matt <matt@lamplightdb. co.uk
      > > </mc/compose? to=matt%40lampli ghtdb.co. uk>>
      > > > ????: [ydn-javascript] Re: DataTable Editor using the TAB key to
      > > > move to the next cell
      > > > ????: ydn-javascript@ yahoogroups. com
      > > </mc/compose? to=ydn-javascrip t%40yahoogroups. com>
      > > > ??????????: ???????, 19 ????????? 2009, 14:06
      > > >
      > > > Thoughts, but haven't tried any of this, and I don't think there's
      > > > anything built in:
      > > >
      > > > - add an event listener for the tab key to your editor
      > > > - work out which cell you're in
      > > > - show the editor for the next cell
      > > >
      > > > Obviously there'll be a bit of extra work to go down to the next
      > > > line, or stop at the last cell of the last row.
      > > >
      > > > Editors have a 'keydownEvent' which you can subscribe to to listen
      > > > for a tab, something like:
      > > >
      > > > editor.on( "keydown" , function(e){ if(e.keyCode == 13 ){
      > > > gotoNextCell( ); }} )
      > > >
      > > > However I'm not sure what the best way to add a listener to all
      > > > editors is... maybe someone else has a good idea?
      > > >
      > > > If you call datatable.getCellEd itor() before it's hidden, you'll
      > > > get the current one (or you can pass the editor in your listener
      > > > to the function that does the cell moving), which then has a bunch
      > > > of methods giving you access to the current record, td, and
      > > > datatable itself etc - look at http://developer. yahoo.com/
      > > > yui/docs/ YAHOO.widget. BaseCellEditor. html
      > > > <http://developer. yahoo.com/ yui/docs/ YAHOO.widget.
      > > BaseCellEditor. html
      > > <http://developer. yahoo.com/ yui/docs/ YAHOO.widget.
      > BaseCellEditor. html
      > <http://developer. yahoo.com/ yui/docs/ YAHOO.widget. BaseCellEditor. html>>>
      > > > which should be enough to work out where to go next.
      > > >
      > > > Sorry if this is telling you what you already know.
      > > >
      > > > Matt
      > > >
      > > > --- In ydn-javascript@ yahoogroups. com
      > > > </mc/compose? to=ydn-javascrip t%40yahoogroups. com>, "George"
      > > > <sdancer75@. ..> wrote:
      > > > >
      > > > > Any recommendation or thought ?
      > > > >
      > > > > Regards,
      > > > >
      > > > > --- In ydn-javascript@ yahoogroups. com
      > > > </mc/compose? to=ydn-javascrip t%40yahoogroups. com>, "George"
      > > > <sdancer75@> wrote:
      > > > > >
      > > > > > Hi,
      > > > > >
      > > > > > Is that possible to use keyboard shortcuts for moving among
      > > > cells when using inline cell editing mode?
      > > > > >
      > > > > > Regards,
      > > > > >
      > > > >
      > > >
      > > >
      > > > ____________ _________ _________ _________ _________ __
      > > > ???????????? ?? Yahoo!;
      > > > ?????????? ?? ?????????? ???????? (spam); ?? Yahoo! Mail
      > > ???????? ???
      > > > ???????? ?????? ????????? ???? ??? ??????????? ?????????
      > > > http://mail. yahoo.gr <http://mail. yahoo.gr
      > <http://mail. yahoo.gr>>
      > > >
      > > >
      > > > ------------ --------- --------- --------- --------- --------- -
      > > >
      > > >
      > > > No virus found in this incoming message.
      > > > Checked by AVG - www.avg.com
      > > > Version: 8.5.423 / Virus Database: 270.14.28/2454 - Release
      > > Date: 10/23/09 14:09:00
      > > >
      > > >
      > >
      > >
      > > ------------ --------- --------- --------- --------- --------- -
      > > ???????????? ?? Yahoo!
      > > ?????????? ?? ?????????? ???? ???? (spam); ?? Yahoo! Mail
      > ???????? ???
      > > ???????? ?????? ????????? ???? ??? ??????????? ?????????
      > > http://login. yahoo.com/ config/mail? .intl=gr
      > <http://login. yahoo.com/ config/mail? .intl=gr>
      > >
      > >
      > > ------------ --------- --------- --------- --------- --------- -
      > >
      > >
      > > No virus found in this incoming message.
      > > Checked by AVG - www.avg.com
      > > Version: 8.5.423 / Virus Database: 270.14.33/2461 - Release
      > Date: 10/26/09 20:22:00
      > >
      > >
      >
      >
      > ------------ --------- --------- --------- --------- --------- -
      > ???????????? ?? Yahoo!
      > ?????????? ?? ?????????? ???? ???? (spam); ?? Yahoo! Mail ???????? ???
      > ???????? ?????? ????????? ???? ??? ??????????? ?????????
      > http://login. yahoo.com/ config/mail? .intl=gr
      >
      >
      > ------------ --------- --------- --------- --------- --------- -
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 9.0.698 / Virus Database: 270.14.46/2477 - Release Date: 11/02/09 20:39:00
      >
      >



      Χρησιμοποιείτε Yahoo!
      Βαρεθήκατε τα ενοχλητικά μηνύ ματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων
      http://login.yahoo.com/config/mail?.intl=gr
    • Show all 15 messages in this topic