Results 1 to 4 of 4

Thread: this.store.byValue is undefined

  1. #1
    Sencha User
    Join Date
    Nov 2015
    Location
    Romania,Timisoara
    Posts
    14
    Answers
    2
    Vote Rating
    1
      0  

    Default this.store.byValue is undefined

    Hello! I've got an error , after calling
    PHP Code:
     field.setValue(field.getStore().getAt(_idx).get(field.valueField)); 
    i get an undefined error in ext debug all


    Code:
    findRecordByValue: function(value) {                          //value = 7560        
    var result = this.store.byValue.get(value),           //result= undefined            
    ret = false;                                                                       
    if (result) {            
    ret = result[0] || result;      
      }        
    return ret;   
     },
    it looks like this.store.byValue is undefined, and from this point js crashes.
    a few facts:

    field is combobox, it has defined valueField and displayField, the value is existent in store, i searched in store.data.items, and the value of _idx is 0 in this case; also, the combobox is created dynamically depending on some data that i get after an ajax call, but the store is predefined.

    Does anybody have any clue what's going on?

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165
    Vote Rating
    79
      0  

    Default

    What version of the framework are you using? Can you create a fiddle (http://fiddle.sencha.com) demonstrating the issue?
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3
    Sencha User
    Join Date
    Nov 2015
    Location
    Romania,Timisoara
    Posts
    14
    Answers
    2
    Vote Rating
    1
      0  

    Default

    Version is: 5.1.3

    Hello, i'm sorry but i can not reproduce it in fiddler, since the combobox is created dynamically. i looked over other stores in the same function, and it looks like they all have that property called byValue, the issue is here. is something that might cause the disappearing of byValue property?

  4. #4
    Sencha User
    Join Date
    Nov 2013
    Posts
    2
    Vote Rating
    0
      0  

    Default

    This post is old but I came across it on Google so I'm posting a solution. byValue is a method added by the Combobox onBindStore method. If you set the store as part of the the initial config or by using setStore the method will be available. Otherwise if the store is set using this.store = the onBindStore method will not fire and byValue will will not be available. This prevents setValue and getSelectedRecord and potentially other functions from working.

Similar Threads

  1. Store is undefined
    By manilodisan in forum Ext: Discussion
    Replies: 2
    Last Post: 13 Nov 2013, 8:19 AM
  2. Replies: 6
    Last Post: 29 Jul 2012, 1:20 PM
  3. Replies: 5
    Last Post: 26 Mar 2012, 12:43 PM
  4. Store undefined
    By eryx in forum Sencha Touch 1.x: Q&A
    Replies: 2
    Last Post: 9 Feb 2012, 1:13 PM

Tags for this Thread

Posting Permissions

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