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

    I have created a CMP that shows the user a MODx.grid.
    To this graid I have added a right-click action to update, createing a MODx.window for editing.

    Problem: Window and form open fine first time and will allow update. However any subsequent update on the same record or a different record will populate the update form with the values of the first!! So I can't update any other record.

    Code below: I assume that when I refresh the grid, the this.menu.records should get refreshed, this however does not seem to happen.

    Any help much appreciated smiley

    /* Run this after the user update a game category page */
        ,update:
    
            function(btn,e) {
                if (!this.CreateGameCategory) {
                    this.CreateGameCategory = MODx.load({
                        xtype: 'modx-window-game-category-update'
                        ,record: this.menu.record
                        ,listeners: {
                            'success': {fn:this.refresh,scope:this}
                        }
                    });
                }
                this.CreateGameCategory.setValues(this.menu.record);
                this.CreateGameCategory.show(e.target);
    
            
        }
    
      • 15083
      • 697 Posts
      Another issue I am having is with the new xcheckbox type.
      I am adding an xcheckbox input to my update form:

      {
                   xtype: 'xcheckbox'
                  ,fieldLabel: 'Category Active'
                  ,name: 'active'
                  ,inputValue: '1'
              }
      


      However the value never gets set. In the DB the value is stores as a tinyint, 1 or 0.
      All my records howerver show as unchecked, despite being 0.
        • 47768
        • 14 Posts
        Quote from: jusmeig at Jan 10, 2012, 11:29 AM
        Another issue I am having is with the new xcheckbox type.
        I am adding an xcheckbox input to my update form:

        {
                     xtype: 'xcheckbox'
                    ,fieldLabel: 'Category Active'
                    ,name: 'active'
                    ,inputValue: '1'
                }
        


        However the value never gets set. In the DB the value is stores as a tinyint, 1 or 0.
        All my records howerver show as unchecked, despite being 0.

        I know this post is old, but I have the same problem. My code:

        {
        	xtype: 'xcheckbox',
        	name: 'elected',
        	hideLabel: true,
        	boxLabel: _('politicians.elected'),
        	inputValue: 1,
        	checked: config.record.elected || false
        }


        even though config.record.elected is '1' the checkbox is never checked.
        UNLESS I update a record in the grid first, then that record will have the checkbox properly set.

        Is there some lazyload something trick that needs to be applied?
          --
          MODX Revolution 2.2.14-pl (traditional)