[CLOSED] when gridpanel column apply renderer.format , renderer.fn not work

  1. #1

    [CLOSED] when gridpanel column apply renderer.format , renderer.fn not work

            Dim objRender As New Ext.Net.Renderer
            objRender.Format = RendererFormat.UsMoney
            objRender.Fn = "editcolor"
            mobjExtNet.ExtNetGridPanel_Columns.Item(4).Renderer = objRender
    When remark objRender.Format = RendererFormat.UsMoney
    Cell text can change to my Fn setting
    Last edited by Daniil; Mar 19, 2013 at 5:25 AM. Reason: [CLOSED]
  2. #2
    Hello,

    Fn and Format excludes each other. You can use a single one of these options at the same time.

    Actually, Format="UsMoney" is just:
    return Ext.util.Format.usMoney(value);
    So, you can easily implement it with a Fn.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { 90.99 },
                    new object[] { 90.99 },
                    new object[] { 90.99 }
                };
                store.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <script>
            var myRenderer = function (value) {
                value = Ext.util.Format.usMoney(value);
    
                return value + " test";
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server">
                <Store>
                    <ext:Store runat="server">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="test" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column runat="server" Text="Test" DataIndex="test">
                            <Renderer Fn="myRenderer" />
                        </ext:Column>
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Column Renderer Fn doesn't work at first time in TreeGrid
    By profitsistemas in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 21, 2013, 12:34 AM
  2. [CLOSED] Column renderer does not work for treeGrid
    By SymSure in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 14, 2012, 1:22 PM
  3. GridPanel Renderer doesn' work
    By AlexMaslakov in forum 1.x Help
    Replies: 2
    Last Post: Aug 25, 2011, 1:46 PM
  4. [CLOSED] [1.0] Column Renderer Format/Handler
    By state in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 24, 2010, 7:49 PM
  5. [FIXED] [V0.6] GridPanel Renderer Format
    By Timothy in forum Bugs
    Replies: 2
    Last Post: Sep 03, 2008, 5:19 PM

Tags for this Thread

Posting Permissions