Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha Premium Member froamer's Avatar
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    101
    Vote Rating
    2
    froamer is on a distinguished road

      0  

    Default OO Design in Designer

    OO Design in Designer


    I have been trying to build an encapsulated class in the designer then use instances of it in various places in my designer project.

    At the moment it is not easy to "expose" the properties of children in the top level instance. You have to override the initComponent and tweak things there.

    I think it would be a great idea to allow code in values of properties to make this whole process easier.

    Here is a simple example.

    I have a Panel called EntityList. It contains a grid and a paging toolbar. Both of these children require the same store which is passed to the EntityList instance via a custom property (myStore). For efficiency I do not want to render the grid and paging toolbar with the wrong store then reconfigure them with the store set for this instance, so at the moment I am forced to override the initComponent and build my own children, settings the store for these two children.

    However, if basic code could be used within property values, the grid and paging toolbar store properties could be set something like this...

    store: this.myStore

    where myStore is a custom property added to the EntityList panel. This would allow each instance to set a different store.

    Of course having simple code in property values could have a whole host of other uses, not just exposing child properties at the top level, but it is a pretty useful one for OO development.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,064
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    I like the idea in theory, but we are trying to stay very close to the SDK's. If Ext JS or Sencha Touch have the ability to provide a function as a configuration value for thos econfigurations, we will provide an editor for that. (which there are already some examples of this in the SDK)

    In other cases, we will not.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member froamer's Avatar
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    101
    Vote Rating
    2
    froamer is on a distinguished road

      0  

    Default


    Hi Aaron,

    I am only talking about the generated code in initComponent changing from this...

    PHP Code:
    items: [
                    {
                        
    xtype'gridpanel',
                        
    itemId'grid',
                        
    store'SomeStore',
                        ... 
    to this...

    PHP Code:
    items: [
                    {
                        
    xtype'gridpanel',
                        
    itemId'grid',
                        
    storethis.myStore,
                        ... 
    I'm not talking about anything you couldn't do if you hand crafted the code.

    In other words, the ability to set a property to something other than a string literal.

  4. #4
    Sencha Premium Member froamer's Avatar
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    101
    Vote Rating
    2
    froamer is on a distinguished road

      0  

    Default


    The more I look at this, the more this makes the designer impractical for object-oriented projects or for benefiting from any real reuse within your project.

    As far as I can see it is impossible to design a class in the designer that you can use elsewhere for anything other than the most basic examples.

    When you link something in to use an instance of it, it is only possible to adjust it's properties and not those of its children. You can add custom properties, but you cannot pass their values on to the children's properties prior to the initComponent running, after which it is too late.

    The only way around this is to override the initComponent so you can manually set the children's properties. But if you do that you can no longer visually design the class and you have to hand craft everything in the override.

    This makes the designer almost unusable for anything other than basic "demo" projects.

    Perhaps I am missing something, but try it yourself. Create a panel containing a grid with a paging toolbar. Design it so you can reuse the panel and set the store in the instance (i.e. so it can be used in more than one place with different stores). You will need to somehow set the store for the grid and paging toolbar children of the panel. But you can't because the designer will only let you set their stores to a string literal. So you have to override initComponent :-(

    The solution as I see it will improve the designer ten-told and make it something I can actually use.

    Allow property values to accept simple code.

    You will need to spot what is code and what is not, perhaps code is placed in {} (or some other parenthesis)

    So in the designer you could create a custom field called mystore, then while editing the properties of the grid and paging toolbar in the example above you could type...

    store: {this.mystore}

    When the initComponent is generated, instead of generating this code...

    store: '{this.mystore}'

    it would generate...

    store: this.mystore

    This is doing nothing more than what I could do if I was hand crafting the code, so it is not in contention with the API.

    Not only does this open up the world of encapsulation and reuse, but the possibilities are endless. Here are some other good examples...

    width: {this.defaultWidthForDevice()}

    title: {this.currentUsername()}

    ..examples of intelligent property values with helper functions.

    I offer this suggestion with decades of experience in OO. In that time I have developed OO development environments for major corporations and I see your development of the designer going through a similar evolution. In my view adding the ability for property values to be intelligent would be a major step forward for the designer from a prototyping tool into a full Ext/Touch development environment.

  5. #5
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    515
    Vote Rating
    20
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default


    The best ExtJS/sencha way to do this, afaik is to set a custom config property on the top level component, then create magic updateConfigProperty that is aware of it's children and set the property on the needed children.

    I guess you also can use the magic function to trigger an event, where the children catches the event and updates is properties.

    e.g
    Panel.MyStore = 'YooStore' (set in designer)
    Panel.updateMyStore = function(value) {
    this.down('grid').setStore(Value);
    this.down('grid2').setStore(Value);
    }
    Sven Tore Iversen

  6. #6
    Sencha Premium Member froamer's Avatar
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    101
    Vote Rating
    2
    froamer is on a distinguished road

      0  

    Default


    That could work Sven,

    but it is not as flexible as allowing code in property values which not only solves the exposure of child properties but it also opens the door to intelligent property values.

    I'm not suggesting we write full blown functions in the property list, but just the ability to reference parent properties and helper functions.

    As a work around I am thinking of overriding Ext.applyIf so if the object contains a property flag (e.g. convertMeValues === true) it converts all property values prefixed with 'me. by removing the quotes.

    This will give me most of what I want but it would be great if it was supported in the designer.