Calling parent DS in optiondatasource and its picking values from original field.

I need to use same dataSource as optiondatasource for self join (parent child relation) of same table but field is behaving like the original field and also picking up values of field defined displayField.

isc.RestDataSource.create( {
ID :“employeeDS”,
dataFormat :“json”,
recordName:“emp”,
showPrompt: false,
jsonRecordXPath :“/emp/data”,
xmlRecordXPath :“/emp/data/*”,
fetchDataURL :“services/empService/emps/{dbid}”,
addDataURL :“services/empService/emps”,
updateDataURL :“services/empService/emps/{dbid}”,
removeDataURL :“services/empService/emps”,
title :“Employees”,

fields : [ {
name :“empid”,
title :“Emp Id”,
type :“text”,
primaryKey :true,
canEdit :false,
hidden :true,
length :10
},

, {
name :“name”,
title :“Name”,
type :“text”,
length :50,
required :true
},
{
name :“empcode”,
title :“Emp Manager”,
valueField :“empid”,
displayField :“name”,
optionDataSource :“employeeDS”,
autoFetchDisplayMap:false

}]

Hi Danny,

What are you expecting will happen - you want it to use the data already in the grid as a valueMap? This isn’t automatic, but you could do it yourself via grid.data.getValueMap() and then setValueMap() on the field. Just bear in mind all the data would need to be loaded (no data paging) and there would need to be no filter criteria, which might eliminate rows.