I have come back to this topic for my project and I figured out that maybe this is not the right solution. There was mentioned onBeforeSave event, but maybe marceloparra want something that I understood as my problem too.
I'll try to explain.
I have simple datagrid with some columns and 1 "id" of school column. List of schools is in other table through second request:
Datagrid request: ***php?operation=getPersons (simple select form 1 table)
return name, surname and id_scholl
Combobox editor (school selector) request: ***php?operation=getRequest&type=graduation (simple select from 1 table)
returns id and scholl_name {1,basic scholl,2, college,etc...)
This shows following id_school in datagrid column as on picture no.1
I changed sql query for Datagrid request, and I'v combined select form table persons (datagrid) and table of schools (combobox editor for field in datagrid), at put it to "virtual" column.
Then at datagrid :
formatter:function(value,row,index){
return row.school; //Instead of value which is id_school by default in select query of datagrid url
}
And everything works properly for me as on picture no.2
After editing row, combobox works properly as on picture 3.
With this, I just show school name instead of school ID in datagrid in NON editing row.
I could not solved it directly in datagrid column configuration, Editor of column was not returned (either with edatagrid):
datagrid{columns[[......
field: colName.....,editor{combobox},
formatter:function(value,row,index){
var ed = $(this).edatagrid('getEditor',{index: index,field: 'colName'}); <------- Nothing returned
}
...]]...}