Hello friends,
I have a column on the ParamQuery Grid where I make a user selection and I use select here. Since I don't have a chance to know the user ID value when logging in, I store it as id=value and display it as text=label.
I store the ID value in the database but I display the label (text) value on the grid.
Everything works correctly up to this point, but when I export the grid to Excel, dataIndx, that is, value (ID), appears instead of label.
Is the method I am using correct?
,{title:'User Select',dataIndx:'user4',dataType:'string',minWidth:24,width: 100,halign:'center',aciklama:'user4_name'
,hidden:false,editable:true,skipExport: true
,editModel:{ saveKey: $.ui.keyCode.ENTER, keyUpDown: false}
,editor:{type:'select',labelIndx:'label',valueIndx:'value',prepend: {'':'' },options: userList}
,render: function (ui) {return ui.rowData['user4_name']}
}
,{title:'User Name',minWidth:24,width:100,dataIndx:'user4_name',dataType:'string'
,hidden:true,editable:false,skipExport: false,exportRender:true
}
Matching formula with label:
formulas: [
['user4_name', rd => (userList.find(opt => opt.value == rd.user4) || {}).label || ""]
]
User list:
<script>
var userList = [
{"value":1031,"label":"Paramvir Dhindsa"},
{"value":1051,"label":"?merix Turk"},
{"value":1026,"label":"Bill Gates"}
]
</script>