1. #1
    Touch Premium Member
    Join Date
    Sep 2007
    Posts
    10
    Vote Rating
    0
    ghellman is on a distinguished road

      0  

    Question Item Selector setValue Problem/Question (4.1B-2)

    Item Selector setValue Problem/Question (4.1B-2)


    In using setValue for the ItemSelector, I find that I need to use something like "[0,1001,1002,1003,0]" instead of "[1001,1002,1003]" (in which case the first and last do not show up).

    When I use firebug console -- e.g.,
    Ext.getCmp('affschools-selector').setValue([1038,1024,1037,1027,1036,1025]);
    -- works fine - all 6 values show up.

    But in code - (an MVC app) when I do a store load, then use Ext.Pluck to get the values; then JSON.encode; then same Ext.getCmp('affschools-selector').setValue([1038,1024,1037,1027,1036,1025]);
    -- first and last entries do not show up.

    I do not know if this is a bug.
    My workaround of prepending and appending '0' seems to indicate some parsing "fluke".

    Please advise a better way to do this (another/better workaround ?), or confirm that it might be a bug.

    Also please let me know if you need additional info.

    Thanks
    Gary

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,791
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Using the MultiSelect demo, there is an options button that allows you to choose a set value option and it uses setValue on the ItemSelector that looks like:

    Code:
    Ext.getCmp(fieldId).setValue(['2', '3']);
    This works flawlessly.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Touch Premium Member
    Join Date
    Sep 2007
    Posts
    10
    Vote Rating
    0
    ghellman is on a distinguished road

      0  

    Default


    Yes - I noticed that in the MultiSelect demo the setValue works flawlessly as you said....
    Also, in the firebug console, doing the same, works flawlessly.

    But when loading those values from a store, in code, it does not work flawlessly....
    That is why I posted my question.


    Thanks
    Gary

  4. #4
    Touch Premium Member
    Join Date
    Sep 2007
    Posts
    10
    Vote Rating
    0
    ghellman is on a distinguished road

      0  

    Default


    Probably the issue comes from my data (coming from the backend/server/database) being integers.
    So the store does not give me the single quotes surrounding each item in the array (as in the example you mentioned) - the "parsing" maybe expects a "token" of single quote or comma or close square bracket - so it ignores the first and last entry.

    I am using "Pluck" to get the data out of the store --
    var jsonData = Ext.encode( Ext.pluck(
    Ext.pluck(affSchoolsStore.data.items, 'data'), 'departId') );

    but the data come out with no single quotes....

    Any suggestions on how to get the "better to have" single quotes using "Pluck"?

    Thanks
    Gary

Thread Participants: 1

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