Results 1 to 9 of 9

Thread: FormSelect with array?

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
      0  

    Default FormSelect with array?

    Hello all,

    Want to load the Locations dynamic from a json, this all goes good and it works on desktop too, i load them in the select and they are shown on the desktop, but I can't press on the select box on the phone, (the pop up to select the location doesn't show, it works in google chrome on the desktop).

    Anyone knows how to make this work on the iphone.

    Make an array with datastore location values

    Code:
    // Automatisch locaties inladen.
            var optionsLocations = [];
     
            datastore3.each(function(rec){
                optionsLocations.push({
                    value: rec.get('locatie'),
                    text: rec.get('locatie')
                });
    });
    The formpanel:

    Code:
    { 
          xtype: 'fieldset',
          cls: 'searchFormBody',
          items: [
    		{
                        xtype: 'select',
                        id: 'locatieSelect',
                        label: 'Welke Locatie?',
                        options: optionsLocations,
                        listeners: {
                            change: function(select, value){
                                if(value === 'Alle Locaties'){
                                    this.get(distanceSlider).hide();
                                } else {
                                    this.get(distanceSlider).show();
                                }
                            },
                            scope: this
                        }
    	},

    So i can press on the select when i use desktop google chrome, but not when i use safari on iphone. Someone knows how this works?

  2. #2
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
      0  

    Default Someone?

    Still don't know how to fix

    Someone can look into the problem?

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
      0  

    Default ?

    bump

  4. #4
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Default

    Is this another component?
    Code:
    this.get(distanceSlider)
    Are you looking for something like show/hide some panel based on the Select Box selection?

    Could you provide a working demo of this.

  5. #5
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
      0  

    Default

    Hey,

    Thanks a lot for the reply. In short I want: a select field with values that are loaded from datastore or array.

    So let's say my form must search on location, but only the locations are shown in the select (dropdown) of the locations which are in the Json, I dont want that people can search on let's say new York, if there are no results on New York.

    At the moment i have it working, but I can't press the select field on the iphone, the pop up to select a city doesn't show, probably i am doing something wrong, the desktop browser catches it and fix it, the iphone doesn't.

    Kevin

  6. #6
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Default

    Iphone will be showing a picker in the case of selectfield and for empty store, picker will be not shown.

    I think that will be the reason.

  7. #7
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
      0  

    Default

    When i log the datastore it shows 5 values, when i put: store: datastoreName, i get the good amount of fields, but they are empty (no location is shown as 'New York', but exactly 5 empty select fields are shown. The reason for this may be because all objects in the datastore have only one value? (location name), i do this so i won't get duplicated Location names.

    Kevin

  8. #8
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Default

    If you can provide a test code, i can look in to it

  9. #9
    Sencha User
    Join Date
    Sep 2010
    Location
    Netherlands
    Posts
    190
    Vote Rating
    0
      0  

    Default The solution

    Thanks for the support tomalex0,

    Guess what? Yeah i found out why it was not working, all code i wrote was working from the start, even the options: arrayName here is no problem and has nothing to do with the fact that the ontap doesn't work on mobile.

    The problem lies in the fact that i didn't give a Name attribute to it...

    Seriously sencha dev team. Why you need a name attribute for the on tap handler, couldn't you use ID which most people use anyway, since we want components to have unique value?

    Kevin

Similar Threads

  1. Replies: 0
    Last Post: 21 Jun 2010, 9:17 AM
  2. Replies: 6
    Last Post: 1 Apr 2009, 8:12 AM
  3. newbie question: how json read array of array ?
    By cc96ai in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 20 Aug 2008, 4:08 PM
  4. Array.sortDates ,Array.unique, and extended Array.indexOf
    By wm003 in forum Ext 2.x: User Extensions and Plugins
    Replies: 3
    Last Post: 4 May 2008, 12:38 AM
  5. Replies: 3
    Last Post: 29 Apr 2008, 7:57 AM

Posting Permissions

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