1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    diegofavero is on a distinguished road

      0  

    Default How to Acess Store´s data by its own element

    How to Acess Store´s data by its own element


    [SOLVED]

    Hi there ...
    First, excuse me if my questions sounds stupid, but, im still learning about Ext Js and few topics are not clear yet.

    Thats the scope (using extJs 4 )

    I have a store like this:
    Code:
            this.siteStore = Ext.create('Ext.data.Store', {
                 fields : ['id', 'name'],
                  proxy : {
                      type : 'ajax',
                      actionMethods : 'GET',
                      extraParams : {},
                      url : 'Sites/List/combo',
                      reader : {
                          totalProperty : 'length',
                          type : 'json',
                          root : 'rows'
                      }
                  }
              }),
    And after load, o got a set of results like this:

    Code:
    {"id":71,"name":"Israel"},{"id":57,"name":"Pakistan"},{"id":46,"name":"SWISS 0"},{"id":47,"name":"SWISS 1"},{"id":48,"name":"SWISS 2"},{"id":76,"name":"SWISS LX"},{"id":34,"name":"Tunisia"}
    The Question:
    How do I get the 'id' when 'name' is equal (lets say), Pakistan
    ....

    I tried to use:
    Code:
    this.siteStore.find('name', this.fsite.getValue())
    But this only returns -1 or 1 ....

    Thanks in advance !

    Diego
    Last edited by diegofavero; 3 May 2012 at 6:22 AM. Reason: Solved

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    diegofavero is on a distinguished road

      0  

    Default Almost there

    Almost there


    if I use:
    Code:
    this.siteStore.getAt(this.siteStore.find('name', this.fsite.getValue())).id
    or
    Code:
    this.siteStore.findRecord('name', this.fsite.getValue()).id
    I will get a value like this:
    Code:
    Ext.data.Store.ImplicitModel-ext-gen1046-67
    which '67' is the value I want ...

    now, I could change my question :

    How to split the wanted result ????

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    diegofavero is on a distinguished road

      0  

    Default I got it ....

    I got it ....


    After almost 24h squizing my brain and the google, I could figure-out how to get the value I needed.

    I just have to use:
    this.siteStore.getAt(this.siteStore.findRecord('name',this.fsite.getValue()).index).data.id ....


    A special thanks to nobody from this forum by help me out about this !!!!!

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi