1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    168
    Vote Rating
    4
    SeaSharp2 is on a distinguished road

      0  

    Default Optional and mandatory config properties - TypeScript related,

    Optional and mandatory config properties - TypeScript related,


    I am in the process of creating a TypeScript type library for Sencha Touch using JDduck json files. My intention is to define one TypeScript config class as a buddy for each main Sencha Touch class also declared in TypeScript.

    The problem is that I started this process with an assumption that all properties in my XxxxxConfig class should be optional (TypeScript has a special syntax for optional class fields). However I notice that for a majority of ST classes the constructor method config parameter is mandatory, which implies some config properties must be supplied on class create.

    Looking at the JSON attributes for each config property I cannot see an attribute that indicates which config properties must be supplied during class create.

    Can anyone explain this ambiguity?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,795
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Example of a class that can't be created without a config object?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    168
    Vote Rating
    4
    SeaSharp2 is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Example of a class that can't be created without a config object?
    Here are some I found by inspecting the JSDuck documentation json.

    Ext.Component
    Ext.data.reader.Reader
    Ext.slider.Slider
    Ext.Map
    Ext.layout.Abstract

    Since posting my OP I can now see that the high proportion of classes having a non optional config constructor method parameter is because the list of classes includes some common base classes such as Component and Layout.Abstract.

    Even so my original confusion remains... is it possible to identify which config properties are mandatory for a class that has a mandatory config constructor parameter?

    The basis for my question is the following in the JSDuck generated doc json. See option "optional": false,
    PHP Code:
        "method": [
          {
            
    "tagname""method",
            
    "name""constructor",
            
    "owner""Ext.data.reader.Reader",
            
    "doc""\n",
            
    "params": [
              {
                
    "type""Object",
                
    "name""config",
                
    "doc""\n",
                
    "optional"false,
                
    "default"null,
                
    "properties": [

                ],
                
    "html_type""Object"
              
    }
            ], 

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi