Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22268

Re: managing buttons

From Une Bévue <unbewusst.sein@fai.invalid>
Newsgroups comp.lang.javascript
Subject Re: managing buttons
Date 2013-12-09 07:02 +0100
Organization Posted through ALPHANET (http://www.alphanet.ch/)
Message-ID <l83mee$arr$1@shakotay.alphanet.ch> (permalink)
References <l81j4h$7n4$1@shakotay.alphanet.ch> <l81r43$ens$1@dont-email.me> <XnsA290B2B281B3eejj99@194.109.133.246> <l82tkr$2m5$1@dont-email.me>

Show all headers | View raw


Le 08/12/13 23:59, Norman Peelman a écrit :
>    Again, off the cuff code to get the idea out to the OP. I'm sure they
> would have figured that out. If not, they'd be back.

from your idae, I'm testing a first implementation.

firstly, i define the states of my controller :
var states=['view_categories', 'add_category', ..., 'edit_item'];

secondly the ids of all of my buttons :
var buttons=['add_category', 'delete_category',..., 'save_item', 
'cancel_item'];

and endly an object representing the enabled buttons per state of the 
controller :

var buttonsEnabled={
   view_categories: ['add_category']
...
   , view_item:     ['add_category',  'delete_category', 
'edit_category', 'add_item', 'delete_item', 'edit_item']
   , add_item:      ['save_item', 'cancel_item']
   , edit_item:     ['save_item', 'cancel_item']
};

then, when the controller enters a new state i have to do :

state= "the new state";
and :
buttonsControl();

the function buttonsControl(), firstly disable all the buttons and 
afterwards enables only the buttons following the state by buttonsEnabled.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

managing buttons Une Bévue <unbewusst.sein@fai.invalid> - 2013-12-08 11:54 +0100
  Re: managing buttons Norman Peelman <npeelman@cfl.rr.com> - 2013-12-08 08:10 -0500
    Re: managing buttons Une Bévue <unbewusst.sein@fai.invalid> - 2013-12-08 15:03 +0100
    Re: managing buttons "Evertjan." <exjxw.hannivoort@interxnl.net> - 2013-12-08 16:34 +0000
      Re: managing buttons Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-08 20:12 +0000
      Re: managing buttons Norman Peelman <npeelman@cfl.rr.com> - 2013-12-08 17:59 -0500
        Re: managing buttons Une Bévue <unbewusst.sein@fai.invalid> - 2013-12-09 07:02 +0100
      Re: managing buttons Une Bévue <unbewusst.sein@fai.invalid> - 2013-12-09 06:24 +0100
        Re: managing buttons "Evertjan." <exjxw.hannivoort@interxnl.net> - 2013-12-09 20:34 +0000
          Re: managing buttons Norman Peelman <npeelman@cfl.rr.com> - 2013-12-09 23:05 -0500
            Re: managing buttons "Evertjan." <exjxw.hannivoort@interxnl.net> - 2013-12-10 08:55 +0000
              Re: managing buttons Norman Peelman <npeelman@cfl.rr.com> - 2013-12-10 07:07 -0500
    Re: managing buttons Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-08 19:35 +0100
      Re: managing buttons Une Bévue <unbewusst.sein@fai.invalid> - 2013-12-09 06:26 +0100

csiph-web