Skip to content

Multiple Icons #5

@SY-Me

Description

@SY-Me

Hi,

I've got a pb...In my project, i've got a multiple iconselect in a table (env.200).
To setup all icons i've got no soucy, but when i changed it, i try to get the value of this, but it doesn't work. I tried to indent the iconselect variable but nothing. Can you help me??? Thx a lot.

Here you can find my code:

var iconSelect;
var selectedTextValue;
var table_ville=["Reykjavik", "Stockholm", "Tallinn", "Amsterdam"];
var index;
window.onload = function(){

            var icons = [];
            var wheater_icone_select= "wheater_icone_select_"+table_ville[index];

            icons.push({'iconFilePath':'img/1.png', 'iconValue':'1'});
            icons.push({'iconFilePath':'img/2.png', 'iconValue':'2'});
            icons.push({'iconFilePath':'img/3.png', 'iconValue':'3'});
            icons.push({'iconFilePath':'img/4.png', 'iconValue':'4'});


            for (index = 0; index < table_ville.length; ++index) {

selectedTextValue = document.getElementById("wheater_icone_"+table_ville[index]).value;

                iconSelect = new IconSelect(wheater_icone_select, 
                {'selectedIconWidth':30,
                'selectedIconHeight':30,
                'selectedBoxPadding':1,
                'iconsWidth':35,
                'iconsHeight':35,
                'boxIconSpace':1,
                'vectoralIconNumber':4,
                'horizontalIconNumber':4});

                iconSelect.refresh(icons);
                iconSelect.setSelectedIndex(selectedTextValue-1);


            }

$('#wheater_icone_select_ Reykjavik').on('changed', function(){
$('#wheater_icone_ Reykjavik').val(iconSelect.getSelectedValue());
});

$('#wheater_icone_select_ Stockholm').on('changed', function(){
$('#wheater_icone_ Stockholm').val(iconSelect.getSelectedValue());
});
$('#wheater_icone_select_ Tallinn').on('changed', function(){
$('#wheater_icone_ Tallinn').val(iconSelect.getSelectedValue());
});

$('#wheater_icone_select_ Amsterdam').on('changed', function(){
$('#wheater_icone_ Amsterdam').val(iconSelect.getSelectedValue());
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions