1. #31
    Ext User
    Join Date
    Sep 2007
    Posts
    47
    Vote Rating
    0
    kusoft.net is on a distinguished road

      0  

    Default


    thank you for Sierk reply.

  2. #32
    Ext User
    Join Date
    Jun 2007
    Posts
    2
    Vote Rating
    0
    barsol is on a distinguished road

      0  

    Default Custom controls

    Custom controls


    I have a need to define my own composite controls and ran into issues where blank elements were inserted into the view on refresh. I modified appendConfig to loop my child controls and broke table support. I then added a catch for table and now it works great. There may be other 'gotchas', but this was the only one I was aware of.

    Barry

    Code:
      // add a config to the tree
      appendConfig : function(config, appendTo, doUpdate, markUndo) {
      
        if (!appendTo) {
          appendTo = this.treePanel.getSelectedNode() ||
            this.treePanel.root;
        }
        if (appendTo==this.treePanel.root) {
           if (config.window) appendTo.elConfig = config.window;
           delete config.window;
           var c = 0; //Check if there are other elements to add
           for(var k in config) c++;
           if (c==0) return appendTo;
        }
        var canAppend = this.canAppend(config,appendTo);
        if (canAppend !== true) {
          Ext.Msg.alert("Unable to add element", canAppend);
          return appendTo;
        }
        
        var items = config.items;
        delete config.items;   
         
        var id = config.id||(config._node ? config._node.id : Ext.id());
        var newNode = new Ext.tree.TreeNode({id:id,text:this.configToText(config)});
        
        for(var k in config) { 
          if (config[k]===null) {
            delete config[k];
          }
        }
        newNode.elConfig = config;
    
      
        if (markUndo === true) {
          this.markUndo("Add " + newNode.text);
        }
        appendTo.appendChild(newNode);
        
      
        //
        // Custom Control Support
        //
        
        // Load all child objects of this new component
        //      If this is a table that needs to add 'Element' nodes then do so
        //
        if (this.configToText(config) == "<i>table</i>") {
            if (items && items.length) {
              for (var i = 0; i < items.length; i++) {
                  this.appendConfig(items[i], newNode, false);
              }
            }       
        }
        else {  // Loop all child controls
            for(var k in items) {     
                if (this.configToText(items[k]) != "Element") {
                    this.appendConfig(items[k], newNode, false);
                }
            }
        }
    
    
        if (doUpdate !== false) {
          this.updateForm(false, newNode);
        }
        return newNode;    
      }
    Last edited by mystix; 13 Apr 2008 at 5:38 PM. Reason: use [code][/code] tags

  3. #33
    Ext User
    Join Date
    Aug 2007
    Posts
    119
    Vote Rating
    0
    sierk is on a distinguished road

      0  

    Default


    Quote Originally Posted by barsol View Post
    I have a need to define my own composite controls and ran into issues where blank elements were inserted into the view on refresh. I modified appendConfig to loop my child controls and broke table support. I then added a catch for table and now it works great. There may be other 'gotchas', but this was the only one I was aware of.

    Barry
    Barry can you provide a Json with you problem and how to reproduce it, so i can test it and see if there is a more general problem i can solve.

    Sierk

  4. #34
    Ext User
    Join Date
    Jun 2007
    Posts
    2
    Vote Rating
    0
    barsol is on a distinguished road

      0  

    Default Example composite json data

    Example composite json data


    Here ya go.

    Barry
    Code:
         // Composite Controls
         data.push(
            ['CompositeControls',
             'Name',
             'Name Control',          
              {   
                xtype:'fieldset',
                title:'Name Control',
                x: '0',
                y: '0',
                width:  'auto',
                height: 'auto',
                style: 'background:#dfdfdf;',
                items:[{
                    xtype:'textfield',
                    fieldLabel:'First Name',
                    name:'textvalue'
                  },{
                    xtype:'numberfield',
                    fieldLabel:'Last Name',
                    name:'numbervalue'
                  },{
                    xtype:'datefield',
                    fieldLabel:'DOB',
                    name:'datevalue'
                  }],
                autoHeight:true
             }
            ],
              
            ['CompositeControls','SSN',
              'A panel containing form elements',
                  {   
                    xtype:'fieldset',
                    title:'SSN Control',
                    items:[{
                        xtype:'checkbox',
                        fieldLabel:'SSNCanadian',
                        name:'Canadian'
                      },{
                        xtype:'numberfield',
                        fieldLabel:'Number',
                        name:'numbervalue'
                      }],
                    autoHeight:true
                 }
            ]
            );
    Last edited by mystix; 13 Apr 2008 at 5:39 PM. Reason: use [code][/code] tags!

  5. #35
    Ext User
    Join Date
    Mar 2008
    Posts
    12
    Vote Rating
    0
    manzanitatech is on a distinguished road

      0  

    Question How do you add tree nodes to the TreePanel?

    How do you add tree nodes to the TreePanel?


    Thanks for this great tool. I think it is going to make my life easier.

    Is it possible to populate some tree nodes in the root node in the tree panel? If so how would you do it? I'm want to add some static nodes to be able to mock up a screen to show what it would look like when it is plugged into the back end (which is not written yet.)

  6. #36

    Default


    Thanks, this'll be nice, for the detail views, for the grids too for that matter :-)

  7. #37
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    223
    Vote Rating
    0
    tof is on a distinguished road

      0  

    Default GPL

    GPL


    Hi,
    I (at last) put a license on the GUI Builder.
    Sorry I should have done this before !

    So could you please include the gpl file (named COPYING) in your ZIP ?

    see you
    Christophe Badoit
    aka Tof

    My work : Lesiteimmo.com - Unobstrusive ExtJs Powered !

  8. #38
    Ext User
    Join Date
    Aug 2007
    Posts
    119
    Vote Rating
    0
    sierk is on a distinguished road

      0  

    Default


    Quote Originally Posted by tof View Post
    Hi,
    I (at last) put a license on the GUI Builder.
    Sorry I should have done this before !

    So could you please include the gpl file (named COPYING) in your ZIP ?

    see you
    We just released version 1.4 and this has the license in header and file.

    Sierk

  9. #39

  10. #40
    Ext User
    Join Date
    Mar 2008
    Posts
    1
    Vote Rating
    0
    mattup is on a distinguished road

      0  

    Default Is there a way to use GUIDesigner without using Viewport?

    Is there a way to use GUIDesigner without using Viewport?


    I may need to imbed Gui Designer in another application, what is the best way to accomplish this?