FineUI 官方论坛
标题:
Gird内可编辑的dropdownlist按SelectedText显示
[打印本页]
作者:
zhzhwcn
时间:
2016-6-27 11:59
标题:
Gird内可编辑的dropdownlist按SelectedText显示
本帖最后由 zhzhwcn 于 2016-6-27 12:01 编辑
fineui\webcontrols\panelbase.grid\gridcolumn\renderfield\renderfield.cs
GetColumnValue 方法内加入
var editor = Editor[0];
if (editor is DropDownList)
{
var dropdown = editor as DropDownList;
dropdown.SelectedValue = value.ToString();
result = dropdown.SelectedText;
}
else
{
result = value.ToString();
if (HtmlEncode)
{
result = HttpUtility.HtmlEncode(result.ToString());
}
}
复制代码
FineUI\WebControls\PanelBase.Grid\Grid.cs
3814行
cellEditScript = String.Format("var {0}=Ext.create('Ext.grid.plugin.CellEditing',{1});", pluginId, cellEditBuilder);
复制代码
后面加入
cellEditScript += $";{pluginId}.on('edit', function(a,b){{b.record.set(b.column.dataIndex, a.editors.items[b.colIdx].field.getRawValue());}});";
复制代码
就可以了
欢迎光临 FineUI 官方论坛 (https://fineui.com/bbs/)
Powered by Discuz! X3.4