Results 1 to 7 of 7

Thread: Modify existing form field

  1. #1
    Sencha User
    Join Date
    May 2009
    Posts
    104

    Default Modify existing form field

    Is it possible to modify an existing field item? I am looking to dynamically change between a text field and combobox based on a record in a datastore being loaded. Is it possible to do this? Maybe even just give the item: {id: testitem} and no other properties.... Any clarification on this would be much appreciated, thank you!

  2. #2
    Sencha User eschuy's Avatar
    Join Date
    Apr 2009
    Posts
    16

    Default

    I've done something similar. I'm not sure if it's the best practice but what I do is on load I analyze the record, them edit the form accordingly (removing/adding the corresponding fields)

  3. #3
    Sencha User
    Join Date
    May 2009
    Posts
    104

    Default

    I did eventually find some work-arounds for adding/removing form items from a specific location. IE: https://extjs.com/forum/showthread.php?p=85169

    However, is this current practice? Is there something built into Ext that allows you to add/remove a field from a spcific location to maintain a desired field order? Thanks!

  4. #4
    Sencha User eschuy's Avatar
    Join Date
    Apr 2009
    Posts
    16

    Default

    There's an insert() function, if that's what you mean.

  5. #5
    Sencha User
    Join Date
    May 2009
    Posts
    104

    Default

    That might be exactly what I was looking for... I can't believe I missed that. I have been going over the docs for a few hours now...lol.

  6. #6
    Sencha User eschuy's Avatar
    Join Date
    Apr 2009
    Posts
    16

    Default

    Quote Originally Posted by PV-Patrick View Post
    ... I have been going over the docs for a few hours now...lol.
    It happens, just remember to .doLayout() after doing your field juggles, or it won't show on screen.

  7. #7
    Sencha User
    Join Date
    May 2009
    Posts
    104

    Default

    That was exactly what I needed, thank you eschuy! Essientially what I am doing is loading a Region field based on a selected Country, region can either be a combo box filled with predefined regions/states/provinces, or it can be a text field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •