We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Wow, that is not what I expected. Awesome! I'll start putting this in place and give it a whirl.Thanks for the time you have spent on this. This is a project that I am using also as a test case for quick development of a CMP (I have done them in ExtJs before, but wanted to give MIGXdb a run to compare).

    Aside from a few things I have to get used to (less control on the CMP field display) it looks good as far as time spent building goes.

      • 4172
      • 5,888 Posts
      less control on the CMP field display

      now (version 2.6.9) you can do a lot with description_is_code

      https://github.com/Bruno17/MIGX/commit/dde0ba522b443aad2ed22e22993cfd8d081e2c8e

      for example this in the field-description, when description_is_code is checked would produce a customized text-field, parts of code taken from here
      https://github.com/modxcms/revolution/blob/develop/manager/templates/default/element/tv/renders/input/textbox.tpl

      [[migxJsonToPlaceholders? &prefix=`tv.` &value=`[[+tv_json]]`]]
      
      <input id="tv[[+tv.id]]" name="tv[[+tv.id]]"
      	type="text" class="textfield"
      	value="[[+tv.value]]"
      	tvtype="[[+tv.type]]"
      />
      
      <script type="text/javascript">
      // <![CDATA[
      
      Ext.onReady(function() {
          var fld = MODx.load({
              xtype: 'textfield'
              ,applyTo: 'tv[[+tv.id]]'
              ,width: '30%'
              ,enableKeyEvents: true
              ,msgTarget: 'under'
              //,allowBlank: {if $params.allowBlank == 1 || $params.allowBlank == 'true'}true{else}false{/if}
              //{if $params.maxLength},maxLength: {$params.maxLength}{/if}
              //{if $params.minLength},minLength: {$params.minLength}{/if}
          
              ,listeners: { 'keydown': { fn:MODx.fireResourceFormChange, scope:this}}
          });
          Ext.getCmp('modx-panel-resource').getForm().add(fld);
          MODx.makeDroppable(fld);
      });
      
      // ]]>
      </script>
      


      availiable placeholders are all fields of the current record
      and as json-strings:
      [[+tv_json]]
      [[+field_json]]
      [[+record_json]]




        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • Will this work at all in 2.6.8? I am so close to launch that I may delay doing an upgrade until later in the month, but that WOULD help clean up the interface

        Now with that, would a single field be able to hold a panel with multiple ExtJS fields/xtypes, whereas using the field as a column or the like?

        • BTW, you answered my question a few posts ago. I had a change in the data structure but was able to figure out how to duplicate and retool the getoptions.productgroup.php.

          excellent work (I am liking dynamicdroptv).

            • 4172
            • 5,888 Posts
            now, with 2.6.10 I've added a placeholder for the rendered formElement.
            I was able to let float for example this three dynamic-dropdown-TVs with this configuration:

            {
                      "MIGX_id":2,
                      "field":"line_id",
                      "caption":"Belongs to Product Line:",
                      "description":"[[$migx_input_float? &field=`line_id`]]",
                      "description_is_code":1,
                      "inputTV":"productlines",
                      "inputTVtype":"",
                      "validation":"required",
                      "configs":"",
                      "restrictive_condition":"",
                      "display":"",
                      "sourceFrom":"config",
                      "sources":"[]",
                      "inputOptionValues":"",
                      "default":""
                    },
                    {
                      "MIGX_id":3,
                      "field":"grp_id",
                      "caption":"Product Group",
                      "description":"[[$migx_input_float? &field=`grp_id`]]",
                      "description_is_code":1,
                      "inputTV":"productgroups",
                      "inputTVtype":"",
                      "validation":"",
                      "configs":"",
                      "restrictive_condition":"",
                      "display":"",
                      "sourceFrom":"config",
                      "sources":"[]",
                      "inputOptionValues":"",
                      "default":""
                    },
                    {
                      "MIGX_id":10,
                      "field":"colors",
                      "caption":"Color Group",
                      "description":"[[$migx_input_float? &field=`colors`]]",
                      "description_is_code":1,
                      "inputTV":"colorgroups",
                      "inputTVtype":"",
                      "validation":"",
                      "configs":"",
                      "restrictive_condition":"",
                      "display":"",
                      "sourceFrom":"config",
                      "sources":"[]",
                      "inputOptionValues":"",
                      "default":"",
                    {
                      "MIGX_id":14,
                      "field":"clear",
                      "caption":"",
                      "description":"<br class=\"clear\">",
                      "description_is_code":1,
                      "inputTV":"",
                      "inputTVtype":"",
                      "validation":"",
                      "configs":"",
                      "restrictive_condition":"",
                      "display":"",
                      "sourceFrom":"config",
                      "sources":"[]",
                      "inputOptionValues":"",
                      "default":""
                    }
                    }


            the chunk 'migx_input_float'
            [[migxJsonToPlaceholders? &prefix=`tv.` &value=`[[+tv_json]]`]]
            
            <div style="float:left;">
            <label for="tv[[+tv.id]]" class="x-form-item-label modx-tv-label" style="width: auto;margin-bottom: 10px;">
            <div class="modx-tv-label-title"> 
            <span class="modx-tv-caption" id="tv[[+tv.id]]-caption">[[+tv.caption]]</span>
            </div>    
            </label>
            <div class="x-form-clear-left"></div>
            [[+tv_formElement]]
            </div>
            


            you need a unique footprint for each chunk, otherwise modx would allways use the parsed code of the first chunk

            that's the whole reason for:
            &field=`line_id`
            [ed. note: Bruno17 last edited this post 9 years, 11 months ago.]
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
            • Nicely done. 2.6.10 available at github?
                • 4172
                • 5,888 Posts
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                • Remind me again, what causes this error to be logged:
                  No foreign key definition for parentClass: productLineColorGroup using relation alias: Resource


                  I know it has to do the the Join tables, but I just can't remember where to correct it
                    • 4172
                    • 5,888 Posts
                    I think, it was the MIGXdb - setting 'Has Extra Connection Table'
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!