【问题标题】:EXT.NET Combobox in gridpanel show value instead of text网格面板中的 EXT.NET 组合框显示值而不是文本
【发布时间】:2012-06-27 13:35:26
【问题描述】:

我在 EXT.NET 中有一个大问题。 我有一个网格面板,里面有一个组合框。 组合框工作正常,但是当网格加载时,如果我单击组合框进行编辑,组合框会显示值而不是文本。 如果我在组合框中选择了一个可能的项目,保存结果并重试编辑同一个组合框,此时显示的值是正确的(我看到了文本,这是正确的。) 按照我的代码:

渲染函数:

var StatusRenderer = function (value, st) {
        var ind = st.find("Value", value);
        var r = st.getAt(ind);
        if (Ext.isEmpty(r)) {
            return "";
        }
        return r.data.Text;
    };

网格面板中的列:

<ext:Column ID="ColumnProfilo" runat="server" DataIndex="Profilo" Text="Profilo">
                            <Renderer Handler="return StatusRenderer(value, #{StoreProfilo});" />
                            <Editor>      
                                <ext:ComboBox ID="ComboBoxProfilo" SelectOnFocus="true" EmptyText="Select a Class"  TriggerAction="All" QueryMode="Local" runat="server" DisplayField="Text" ValueField="Value">
                                    <Store>
                                        <ext:Store ID="StoreProfilo" runat="server" AutoLoad="true" >
                                            <Model>
                                                <ext:Model ID="ModelProfilo" runat="server" IDProperty="Value">
                                                    <Fields>
                                                        <ext:ModelField Name="Text" />
                                                        <ext:ModelField Name="Value" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>            
                                        </ext:Store>
                                    </Store>
                                    <Listeners>
                                        <BeforeQuery Handler="delete queryEvent.combo.lastQuery;" />
                                    </Listeners>
                                </ext:ComboBox>
                            </Editor>
                        </ext:Column>

谁能帮帮我?

【问题讨论】:

  • 如何插入要存储的项目?

标签: c# combobox render ext.net gridpanel


【解决方案1】:

请查看此示例并使用 " 而不是 Handler="..

http://examples1.ext.net/#/GridPanel/Data_Presentation/Editor_Field_Mapping/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-11
    • 1970-01-01
    相关资源
    最近更新 更多