EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: wel on January 08, 2016, 10:37:39 AM



Title: combobox value revert back after pressing on save button in the grid
Post by: wel on January 08, 2016, 10:37:39 AM
I have a problem I have a combobox inside a grid and when I edit the combobox value and then press on save button the value  revert back to previous value !! although the selected value is stored correctly in the database

here is the column code:

Code:
<th data-options="field:'work_group_id',width:20,
                                    formatter:function(value,row){
                                        return row.work_group;
                                    },
                                    editor:{
                                        type:'combobox',
                                        options:{
                                            valueField:'work_group_id',
                                            textField:'work_group',
                                            method:'get',
                                            url:'pages/work_groups.php',
                                            required:true
                                        }
                                    }">Work Group
                                </th>

and a video display the problem.

https://vid.me/Qk62


Title: Re: combobox value revert back after pressing on save button in the grid
Post by: jarry on January 09, 2016, 12:58:57 AM
Please refer to http://www.jeasyui.com/tutorial/datagrid/datagrid12.php


Title: Re: combobox value revert back after pressing on save button in the grid
Post by: wel on January 09, 2016, 06:46:18 AM
Thanks Jarry,
Do I must use the onEndEdit function ?

Code:
onEndEdit:function(index,row){
var ed = $(this).datagrid('getEditor', {
index: index,
field: 'productid'
});
row.productname = $(ed.target).combobox('getText');
},