1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    34
    Vote Rating
    0
    umit is on a distinguished road

      0  

    Default Row Editor with TriggerField and Menu(on Click)

    Row Editor with TriggerField and Menu(on Click)


    Hi Everyone!

    I have a grid with roweditor.
    Now i want to have a triggerfield in the cell and when i press on it, i want to have a menu.

    Is this possible?
    I already tried but i get errors.

    The idea is to have something like a datepicker(timepicker)
    Code:
    Code:
    //.....roweditor ....columns:.....
    {
                header: 'WochenTage',
                dataIndex: 'WOCHE',
                width: 100,
                sortable: true,
                editor:
                    new Ext.form.TriggerField({items:
                    new Ext.menu.Menu({
                    allowBlank: true,
                    items:[{xtype:"label",text:"1"},{xtype:"label",text:"2"}]
                })})
            }
    /....

  2. #2
    Ext JS Premium Member dj's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    573
    Vote Rating
    2
    dj has a spectacular aura about dj has a spectacular aura about dj has a spectacular aura about

      0  

    Default


    You need to override the onTriggerClick function for your TriggerField to do something.
    http://www.extjs.com/deploy/dev/docs...m.TriggerField

    In the onTriggerClick function you could open the menu.

    But why don't you just use a ComboBox with a local store?
    Daniel Jagszent
    dɐɳiel@ʝɐgszeɳt.de <- convert to plain ASCII to get my email address

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    34
    Vote Rating
    0
    umit is on a distinguished road

      0  

    Default


    Thanks for the reply

    I want to have something like a Date picker, when i press the triggerButton, an ext.window shall appear, that is connected to the triggerfield.

    So i tried to abuse the menu for this purpose(you can click in the menu that is connected with a bar but if you click somewhere out, the menu closes)

    But the triggerbutton won't accept items ...

    I dont use a combobox because, its a window(that in the code snipped was just an example)

    So the point is, i want to have a triggerfield, and if you click at it, my formWindow should appear(up or bot to the triggerfield) and when i click somewhere else in the screen it shall disappear
    Any suggestions`how to make something like that?

  4. #4
    Ext JS Premium Member dj's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    573
    Vote Rating
    2
    dj has a spectacular aura about dj has a spectacular aura about dj has a spectacular aura about

      0  

    Default


    This should bring you on the right track
    Code:
    {
      header: 'WochenTage',
      dataIndex: 'WOCHE',
      width: 100,
      sortable: true,
      editor: new Ext.form.TriggerField({
        onTriggerClick: function(e) {
          if (!this.menu) {
            this.menu = new Ext.menu.Menu({
              items:[{xtype:"label",text:"1"},{xtype:"label",text:"2"}]
              // the items should have event listeners that set the field value accordingly 
            });
          }
          // here you would want to sync the items in the menu with the field value (this.getValue())
          // before you show the menu -- keep in mind that the menu and its children might not be rendered yet
          this.menu.showAt(e.getXY()); // or this.menu.show(this.getEl(), 'tl-bl?');
        }
      })
    }
    Daniel Jagszent
    dɐɳiel@ʝɐgszeɳt.de <- convert to plain ASCII to get my email address

  5. #5
    Sencha User
    Join Date
    Feb 2010
    Posts
    34
    Vote Rating
    0
    umit is on a distinguished road

      0  

    Default


    ty dj
    That was exactly what I was looking for

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi