无法在网格更新中绑定组合框字段的ID [英] Unable to bind the id of the combobox field on grid update
问题描述
我正在尝试使用修改后的值更新表格。当我更新总线类型并进行更新时,后端的绑定值是valueFied,即id。但是,当我仅更新时间并命名时,总线类型单元格会显示displayField,从而导致后端的gridupdate失败,并说整数值错误,由于显示字段是字符串,所以无论我更新什么内容并始终显示类型名称,我将如何始终将valuefield呈现或绑定到后端?
非常感谢。
我通过以下方法解决了此问题:在更新函数中添加以下方法。
if(!Ext.isNumber(gri dRow.data.typebus))
{
gridRow.data.typebus = gridRow.data.id;
};
希望这对某人有帮助。
I'm trying update the grid with the edited values. When I update the bus type and give update, the binded value in the back end is valueFied that's the id, But when I update only time and name the bus type cell renders the displayField which fails the gridupdate at the back end saying Integer value error, since the display field is the string , How would i always render or bind the valuefield to the back end no matter what i update and display always the type name,
here's the fiddle to try.Fiddle
Hoping for a quick response.
Screen Shot of the grid
Thanks much.
I Solved this issue by adding below method in the update function.
if(!Ext.isNumber(gridRow.data.typebus))
{
gridRow.data.typebus = gridRow.data.id;
};
hope this helps someone.
这篇关于无法在网格更新中绑定组合框字段的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!