1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    42
    Vote Rating
    0
    ramgovind is on a distinguished road

      0  

    Default How do I make multiple editors

    How do I make multiple editors


    If you could provide some editor driver concept to implement multiple editors based on the flavor of the application need, it may be same model, or with multiple models (composite key) associated.

    I really appreciate if you could provide some details or throw some light on this.

  2. #2
    Sencha User
    Join Date
    Aug 2012
    Posts
    42
    Vote Rating
    0
    ramgovind is on a distinguished road

      0  

    Default


    Lets say an example if you have list grid with parent model, upon selection of the row editor be initialized with child model. As I have tab deck upon selection of the row, each tab deck is associated with one model.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    I'm not sure how tabs fit into that picture, but there are several GXT examples using editors and drivers to wire up data, and some of those feed off of selection in a Grid/ListStore/Tree.

    Given an item's selection in a grid, allow user to edit it:
    http://www.sencha.com/examples/#Exam...ce:gridbinding

    Edit an object, including a list property in it:
    http://www.sencha.com/examples/#Exam...ropertybinding

    Given an item's selection in a tree, allow the user to edit it:
    http://www.sencha.com/examples/#Exam...factorybinding

    To get a better look at nested editors, check out the GWT documentation on this feature - all of this works exactly the same with GXT 3.
    https://developers.google.com/web-to...GuideUiEditors

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    42
    Vote Rating
    0
    ramgovind is on a distinguished road

      0  

    Default


    Thanks Colin. Hopefully these examples would certainly help me to understand better to implement in our current project.

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    42
    Vote Rating
    0
    ramgovind is on a distinguished road

      0  

    Default


    I could not find an example for PersonPK Composite Key having three unique columns are mapped as Id with PersonProxy, for editor.

    Would you please throw an idea on this

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Quote Originally Posted by ramgovind View Post
    I could not find an example for PersonPK Composite Key having three unique columns are mapped as Id with PersonProxy, for editor.

    Would you please throw an idea on this
    Three columns, each on a different property of the person? Three columns all displaying the ID? Or the ID (i.e. ModelKeyProvider) is based on the contents of three different values in the row?

  7. #7
    Sencha User
    Join Date
    Aug 2012
    Posts
    42
    Vote Rating
    0
    ramgovind is on a distinguished road

      0  

    Default


    yes, this is the one, ID (i.e. ModelKeyProvider) is based on the contents of three different values in the row

  8. #8
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    As with ValueProvider and nulls in intermediate, the PropertyAccess builder can't read your mind to see what you want. Instead, just as with ValueProvider, implement your own with your specific behavior:

    Code:
    class MyCompositeModelKeyProvider implements ModelKeyProvider<MyData> {
        public String getKey(MyData object) {
            //TODO make and return a String that represents the key for this object.
        }
    }
    Remember the JavaDoc for getKey: "Gets a non-null key value that maps to this object. Keys must be consistent and unique for a given model, as a database primary key would be used." (emphasis mine).

  9. #9
    Sencha User
    Join Date
    Aug 2012
    Posts
    42
    Vote Rating
    0
    ramgovind is on a distinguished road

      0  

    Default


    Thank you!

Thread Participants: 1