1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    30
    Vote Rating
    0
    Nagadev is on a distinguished road

      0  

    Default Composite keys in Grid columns

    Composite keys in Grid columns


    Hello,

    My requirement is to have two primary keys (composite key) as columns in the Grid. So when I try to Edit the grid, it has to send composite key values to server along with the other modified columns. is that possible to specify two or more columns as part of id.

    Thanks in advance.

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    why not create and split the composite key on the server side??

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,890
    Vote Rating
    102
    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

      1  

    Default


    Jay's suggestion of using a concatenated key to represent a composite key is probably the easiest and quickest route to go down if you need to get this done quickly.

    Such as:
    Code:
    13980824:9209802
    Where the colon delimits the two keys to form a composite key. The other alternative would be to implement a getId method on the Ext.data.Record object and instead of accessing .id directly throughout our internal framework code to access the getId method.

    The other hurdle that would need to be jumped over would be adding functionality to the readers to be able to interpret composite keys and to know where to retrieve the individual keys from within the data that is loaded. Currently we do this through idProperty which can point to a simple value:

    Code:
    idProperty: 'productId',
    This could be something like:
    Code:
    idProperty: {
       primary: 'productId',
       secondary: 'regionId'
    }
    All and all I'd say this would be a lot of work to get the functionality that you are looking for. I'd suggest going the route of concatenating the keys into a single composite value on the server-side and then use the reader to split the value into the appropriate fields.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      1  

    Default


    Another approach to do it on the front end might be:

    - upon the store's load event,
    - loop through the data, concatenating the keys into a single id field.

  5. #5
    Ext User
    Join Date
    Aug 2009
    Posts
    30
    Vote Rating
    0
    Nagadev is on a distinguished road

      0  

    Default


    Thankyou both for your valuable suggestions, I will try concatenating upon store's load event

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar