1. #1
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    14
    Vote Rating
    4
    emilianm is on a distinguished road

      0  

    Default Unanswered: RadioGroup(/Radio) component and form.loadRecord functionality

    Unanswered: RadioGroup(/Radio) component and form.loadRecord functionality


    It seems that we encountered a issue with RadioGroup(/Radio) components.
    When you design a form you can put any kind of fields and on a later time you can use form.loadRecord(Ext.data.Model record) to populate the entire form.

    This works as expected, excepting the RadiGroup component. If you would like to display the selected Radio when the loadRecord is called with the appropriate values you will discovered that this is not working. You have to relay on the checked property of the Radio component, and to set this manually. This implies an additional asynchronous action after your initial model was loaded.

    If you decide to "render" the data associated with the radioGroup with a different ExtJs 4 component, for example with a plain textfield or with a combobox, everything will work fine after you call form.loadRecord(Ext.data.Model record) and you will have you data directly pre-selected on the screen .

    If you have any solution for this or any comments please do not hesitate to reply.
    Thanks!

  2. #2
    Sencha User
    Join Date
    Aug 2008
    Location
    Gothenburg
    Posts
    157
    Vote Rating
    2
    Answers
    1
    Dr. Flink is on a distinguished road

      0  

    Default


    +1
    Has anyone got this to work as intended?

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2007
    Location
    CT
    Posts
    462
    Vote Rating
    2
    Answers
    1
    ValterBorges is on a distinguished road

      0  

    Default loadRecord and 4.0.7

    loadRecord and 4.0.7


    loadRecord on radiogroup works in 4.0.7.

    However, If the name/id of the group and elements is not correct it will not load.

    The name of the elements has to match the name of the field in the record.
    The name of the elements must not be the same as the radiogroup id.
    The radiogroup cannot contain the name element.

    I'm having an issue with trackResetOnLoad:true and loadRecord(record) and reset() clearing the radio button. There are some mention of these issues in 3.x reports is anyone having this issue?
    ValterBorges@harmonydata.com

    - harmony-data-systems

    Harmony Data Systems - Offering Enterprise Application Architecture and Implementation Services
    (.NET, SQL, DB2, WEB 2.0, EXT)

  4. #4
    Sencha User
    Join Date
    Sep 2010
    Location
    Hyderabad, India
    Posts
    27
    Vote Rating
    0
    nani1216 is on a distinguished road

      0  

    Default


    Code:
    { "data" : 
    [ { "userName" : "Nani1216" },
      { "id" : "RadioGroupName",
        "value" : 
            { "RadioGroupName" : "inputValue" }
      },
      { "id" : "RadioGroupName2",
        "value" : 
            { "RadioGroupName2" : "inputValue" }
      }
    ],"success" : true }
    If i use the above format and the form contains only radiogroup component and no other fields, the radio fields are get selected in form load action.

    If a form contains radiogroup and other fields, only radiogroup data is loaded in to the form and remaining fields are not loaded with data.

    Code:
    { "data" :    { "userName" : "Nani1216" },
      { "id" : "RadioGroupName",
        "value" : 
            { "RadioGroupName" : "inputValue" }
      },
      { "id" : "RadioGroupName2",
        "value" : 
            { "RadioGroupName2" : "inputValue" }
      }
    ,"success" : true }
    Above format loads the "userName" textfield and radiogroup values not selected.
    Notice the difference is only square brackets ( [ ] )