We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22757
    • 41 Posts
    Hey guys!

    I have a few questions concerning ExtJs. I’m currently building my own CMP working with ExtJs. I have managed to get everything running quite fine but there are some small issues i’d like to solve. I tried to solve this with varius Dokumentations but had no luck. I’m sure for you this are trivial problems...

    I have a window to create a new Entity. There i have some select lists (xtype = combo). With those i face various problems. (see code at the bottom if it might help)

    EDIT: Hey i think i found the solution for Problem 1 & 3... would be triggerAction: ’all’.

    1) The moment I select somenthing, every other option disappears. I tried to add lastQuery: ’’ but it did not help.

    2) I want to submit the numerical value not the display value. And it does not. Do i have to add a hidden field or something like that?

    3) I think that’s the same as point 1, but if i want to edit something the select lists are empty but the value the entity allready has.


    The code:
    {
                xtype: 'combo'
                ,fieldLabel: _('tvdates.type')
                ,name: 'type'
                ,id: 'dates-'+this.ident+'-type'
                ,width: 200
                ,fields: [
                    'id',
                    'display'
                ]
                ,store: [
                    [0, 'Live'],
                    [1, 'Konferenz'],
                    [2, 'Studio']
                ]
                ,valueField: 'id'
                ,displayField: 'display'
                ,editable: false
                ,forceSelection: true
                ,lastQuery: ''
            }


    Any ideas? Thanks for your help in advance.
      • 4172
      • 5,888 Posts
      you can do it like its done in dropdown-tv.

      create your select as usual and use ’transform’

      <select id="tv{$tv->id}" name="tv{$tv->id}">
      {foreach from=$tvitems item=item}
      	<option value="{$item.value}" {if $item.selected} selected="selected"{/if}>{$item.text}</option>
      {/foreach}
      </select>
      
      
      <script type="text/javascript">
      // <![CDATA[
      {literal}
      if (!Ext.isIE) {
          MODx.load({
          {/literal}
              xtype: 'combo'
              ,transform: 'tv{$tv->id}'
              ,id: 'tv{$tv->id}'
              ,triggerAction: 'all'
              ,typeAhead: false
              ,editable: false
              ,width: '97%'
          {literal}
              ,listeners: { 'select': { fn:MODx.fireResourceFormChange, scope:this}}
          });
          {/literal}
      }
      // ]]>
      </script>
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 22757
        • 41 Posts
        Thank you, nut i would prefer to have another solution.

        AND found it laugh. I just need hiddenName and combine it with submitValue:false.

        Thanks anyway!