Hybrid View

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    keithrz is on a distinguished road

      0  

    Default PropertyGrid sourceConfig does not seem to do much of anything

    PropertyGrid sourceConfig does not seem to do much of anything


    I'm trying to figure out how to use sourceConfig in PropertyGrid. Nothing seemed to work for me. (v 4.1.1)


    For example, take the example here:
    http://try.sencha.com/extjs/4.1.0/do....1/viewer.html


    If I change the example to include sourceConfig, it does not change the "Available" label:


    Starting code:
    Code:
    /*global Ext:false */
    Ext.onReady(function() {
       Ext.create('Ext.grid.property.Grid', {
          title: 'Properties Grid',
          width: 300,
          renderTo: Ext.getBody(),
          source: {
             "(name)": "My Object",
             "Created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
             "Available": false,
             "Version": 0.01,
             "Description": "A test object"
          }
       });
    });

    One attempt to include sourceConfig (does not change anything - try it!)
    I also tried this same code, but without "Available" in quotes - same result.
    Code:
    /*global Ext:false */
    Ext.onReady(function() {
       Ext.create('Ext.grid.property.Grid', {
          title: 'Properties Grid',
          width: 300,
          renderTo: Ext.getBody(),
          source: {
             "(name)": "My Object",
             "Created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
             "Available": false,
             "Version": 0.01,
             "Description": "A test object"
          },
          sourceConfig: {
             "Available" : {
                displayName: "Available displayName" ,
                renderer: function(value) {
                   return "Available renderer"
                }
             },
          }
       });
    });

    Using deprecated propertyNames work:
    Code:
    /*global Ext:false */
    Ext.onReady(function() {
       Ext.create('Ext.grid.property.Grid', {
          title: 'Properties Grid',
          width: 300,
          renderTo: Ext.getBody(),
          source: {
             "(name)": "My Object",
             "Created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
             "Available": false,
             "Version": 0.01,
             "Description": "A test object"
          },
          propertyNames: {
             "Available": "Available propertyName"
          }
       });
    });

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    keithrz is on a distinguished road

      0  

    Default


    My mistake. sourceConfig is not available until 4.1.2.

    I assumed that sourceConfig was older than 4.1.x since I saw somewhere that propertyNames is going away very soon - 4.2. So if you are on the GPL track, you will have to switch from propertyNames to sourceConfig immediately, without any transition.

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,655
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    That's not the case, the old versions will still work, it will auto convert it to the new syntax and give you some warnings about the new structure.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1

Tags for this Thread