1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    4
    Vote Rating
    0
    ebald is on a distinguished road

      0  

    Question Ext.data.Store with composite Primary Key

    Ext.data.Store with composite Primary Key


    Two questions.

    How could I define a JsonReader with a composite primary key:

    The primary key is composite by two fields:
    • dot_id_document_type
    • cli_tx_document_number

    The JsonReader definition:

    var reader = new Ext.data.JsonReader({
    root : "rows",
    totalProperty : "results",
    id: ???
    }, Client);

    2. How could I rescue the row from the grid?

    record = ds.getById(The component espects an String here, and so?);

    Thank you, but I

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Use:

    Code:
    var reader = new Ext.data.JsonReader({
      root: "rows",
      totalProperty: "results",
      id: 'dot_id_document_type + "-" + obj.cli_tx_document_number'
    }, Client);
    and

    Code:
    record = ds.getById(dot_id_document_type + '-' + cli_tx_document_number);

  3. #3
    Ext User
    Join Date
    Dec 2007
    Posts
    4
    Vote Rating
    0
    ebald is on a distinguished road

      0  

    Question Thank you Condor, but it doesn

    Thank you Condor, but it doesn


    I like that solution, but is there any possibility that the JsonReader doesn

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    It's:
    Code:
    id: 'dot_id_document_type + "-" + obj.cli_tx_document_number'
    getJsonAccessor creates the following function for your id:
    Code:
    new Function("obj", "return obj." + id)

  5. #5
    Ext User
    Join Date
    Dec 2007
    Posts
    4
    Vote Rating
    0
    ebald is on a distinguished road

      0  

    Default It Works!!!

    It Works!!!


    Thank you very much!!

Thread Participants: 1

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