Dec 09, 2019, 8:57 AM
[CLOSED] MultiCombo vs Renderer Problem
Hello,
I have a problem of rendering multiple values in Grid panel Multi Combo Column.
when data binded into Grid panel, the values selected are binded correctly (using renderer function) into Multi combo text area, while weren't checked in (Multi Combo) list.
While the case wasn't appeared when selecting one value only. (the value checked in combo list).
Can you help to detect the problem since i revised all forum similar cases with no success.
I am using C# language as code behind to add a dynamic Multi Combo into EXT Grid Panel as per the below:
I have a problem of rendering multiple values in Grid panel Multi Combo Column.
when data binded into Grid panel, the values selected are binded correctly (using renderer function) into Multi combo text area, while weren't checked in (Multi Combo) list.
While the case wasn't appeared when selecting one value only. (the value checked in combo list).
Can you help to detect the problem since i revised all forum similar cases with no success.
I am using C# language as code behind to add a dynamic Multi Combo into EXT Grid Panel as per the below:
GridPanel1.ColumnModel.Columns.Add(new ColumnBase[] {
new Column
{
Text = fieldDispName,
DataIndex = fieldDBName[i],
ID=fieldDBName[i].Replace(" ", "")+"_COL",
MinWidth=240,
CellWrap=true,
Filter={new StringFilter{ DataIndex=fieldDBName[i] }},
Renderer={ Handler=string.Format("return MultiComboGrid(value, metadata, record, rowIndex, colIndex, store, '{0}')", fieldDBName[i])},
Editor={
new Ext.Net.MultiCombo{
ID=fieldDBName[i].Replace(" ", ""),
Listeners={Select={Handler="App.direct.SelectionChange('" + fieldDBName[i] + "','540');"} },
QueryMode=Ext.Net.DataLoadMode.Local,
ForceSelection=true,
StoreID=StoresIDs[CombosStoreCount],
DisplayField="Name",
ValueField="ID",
Cls=ControlCLS,
TriggerAction=Ext.Net.TriggerAction.All,
MultiSelect=false,
ListConfig= new BoundList{Cls="list-with-empty"}
}
}
},
});
And then using a javascript function as a renderer function for Multi Combo column:
function MultiComboGrid(value, metadata, record, rowIndex, colIndex, store, customParams)
{
var cs = listToAray(App.ComboboxesStores.getValue(), '~');
var mc = listToAray(App.MulticombosIDParam.getValue(), '~');
var names = [];
var indexes = [];
if (value != "" && value != null && value != "-") {
var splited = value.split(",");
var FinalResults = "";
var FinalRID = "";
var arrayLength = splited.length;
for (var z = 0; z< arrayLength; z++) {
console.log(splited[z]);
if (cs.indexOf(customParams + "_Store") != -1) {
var i = cs.indexOf(customParams + "_Store");
var script = "var r=App." + cs[i] + ".getById(" + splited[z] + ");";
console.log(script);
eval(script);
console.log("name: " + r.data.Name);
names.push(r.data.Name);
if(FinalResults=="")
{
FinalResults = r.data.Name;
}
else
{
FinalResults = FinalResults+", "+r.data.Name;
}
} // if (cs.indexOf(customParams + "_Store")
}
return names.join(",");
}
else {
return value;
}
}
Waiting your help and thank you dear.
Last edited by fabricio.murta; Dec 13, 2019 at 3:28 PM.