Version: v10.1p_2016-01-12
Browser: Chrome Version 53.0.2785.116 m
Description:
The Smartclient Doc pertaining select/selectItems in ListGrids mostly shows the same Map per Row.
I wanted to know if it is possible to map each row(record?) to a different selectItem valueMap.
The Doc from optionDataSource states such a feat but i have not been able to find out how to make it work.
With the example below the selectfield shows 2 Options "Verbrennungsmotor" and "fliegen" it shows this on every row
My intended result is that the first Row will show the 2 Options from valuemap[0] and the second row will show the 2 Options from valuemap[1]
Sample Code:
Local Data in JSON Format
reflist[xx] contains the records for the listgrid
valuemap[x] contains the valeMap for each record (this is one of the points i am uncertain as i dont know if this is the correct format to do it)
	Listgrid
	any help/hints are appriciated
							
						
					Browser: Chrome Version 53.0.2785.116 m
Description:
The Smartclient Doc pertaining select/selectItems in ListGrids mostly shows the same Map per Row.
I wanted to know if it is possible to map each row(record?) to a different selectItem valueMap.
The Doc from optionDataSource states such a feat but i have not been able to find out how to make it work.
With the example below the selectfield shows 2 Options "Verbrennungsmotor" and "fliegen" it shows this on every row
My intended result is that the first Row will show the 2 Options from valuemap[0] and the second row will show the 2 Options from valuemap[1]
Sample Code:
Local Data in JSON Format
reflist[xx] contains the records for the listgrid
valuemap[x] contains the valeMap for each record (this is one of the points i am uncertain as i dont know if this is the correct format to do it)
Code:
	
	var reflist = [];
reflist[20] = [];
reflist[20][0] = {Stelle: "3", Name: "Physikalische Ausgänge", };
reflist[20][1] = {Stelle: "4", Name: "Andere Bewegungen", };
var valuemap = [];
valuemap[0] = {"id":"1", "opt" : "Elektrischer Motor", "id":"2", "opt" : "Verbrennungsmotor"};
valuemap[1] = {"id":"1", "opt" : "Unterwasser", "id":"2", "opt" : "fliegen"};
// a Buttonpress triggers this code to fill the grid
select_grid.setData(reflist[20]);
Code:
	
	isc.ListGrid.create({
    ID: "select_grid",
    width: "100%",
    alternateRecordStyles: true,
    autoFitData: "vertical",
    cellHeight: 50,
    canEdit: true,
    autoDraw: false,
    fields:[
        {name:"Stelle", width:"75", canEdit:false},
        {name:"Name", width:"250", canEdit:false},
        {name:"Options", width:"200", editorType: "SelectItem",
            editorProperties : {                    
                displayField : "opt",
                valueField : "id",
                optionDataSource : isc.DataSource.create({
                    dataFormat : "json",
                    ID : "valueDS",
                    clientOnly : true,
                    testData : valuemap
                }),  
            }
        },
        {name:"Beschreibung", width:"*"}
    ]
});
Comment