[CLOSED] [2.3][Store][GridPanel] Remote paging causes ${ to be replaced with Ext.select

  1. #1

    [CLOSED] [2.3][Store][GridPanel] Remote paging causes ${ to be replaced with Ext.select

    I encountered a problem when using GridPanel with remote paging. If one of the fields displayed in the GridPanel has the characters ${, Ext replaces those characters with Ext.select(""). This problem occurs only with remote paging, like the example below. If i remove the page proxy & the refresh event, the gridpanel displays ok.

    How can I avoid this replace? Is there a property on Store/GridPanel/ResourceManager?

    The following code is a test example for this issue:
    <%@ 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)
            {
                this.Store1.DataSource = this.Data;
                this.Store1.DataBind();
            }
        }
    
        public void EntityStoreMaterials_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            e.Total = Data.Length;
            this.Store1.DataSource = GMWeb.Utils.Helpers.RemoteOperationsHelper.GetValues(e, Data.ToList());
            this.Store1.DataBind();
        }
    
        private object[] Data
        {
            get
            {
                return new object[]
                {
                    new object[] { "3m ${ Co", 71.72, 0.02, 0.03, "9/1 12:00am" }
                };
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Simple Array Grid - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
        <style>
            .x-grid-row-over .x-grid-cell-inner {
                font-weight: bold;
            }
        </style>
    
        <script>
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <h1>Simple Array Grid</h1>
    
        <ext:GridPanel
            ID="GridPanel1"
            runat="server"
            Title="Array Grid"
            Width="600"
            Height="350">
            <Store>
                <ext:Store ID="Store1" runat="server" PageSize="10" OnReadData="EntityStoreMaterials_RefreshData">
                    <Proxy>
                        <ext:PageProxy>
                            <Reader>
                                <ext:JsonReader></ext:JsonReader>
                            </Reader>
                        </ext:PageProxy>
                    </Proxy>
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="company" Type="String" />
                                <ext:ModelField Name="price" Type="Float" />
                                <ext:ModelField Name="change" Type="Float" />
                                <ext:ModelField Name="pctChange" Type="Float" />
                                <ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel>
                <Columns>
                    <ext:Column runat="server" Text="Company" DataIndex="company" Flex="1" />
                    <ext:Column runat="server" Text="Price" DataIndex="price">
                        <Renderer Format="UsMoney" />
                    </ext:Column>
                    <ext:Column runat="server" Text="Change" DataIndex="change">
                        <Renderer Fn="change" />
                    </ext:Column>
                    <ext:Column runat="server" Text="Change" DataIndex="pctChange">
                        <Renderer Fn="pctChange" />
                    </ext:Column>
                    <ext:DateColumn runat="server" Text="Last Updated" DataIndex="lastChange" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel runat="server" />
            </SelectionModel>
            <BottomBar>
                <ext:Toolbar runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Print" Icon="Printer" Handler="this.up('grid').print();" />
                    </Items>
                </ext:Toolbar>
            </BottomBar>
        </ext:GridPanel>
    </body>
    </html>
    This is the error that appears when loading the above example:
    Attached Thumbnails Click image for larger version. 

Name:	Error.png 
Views:	72 
Size:	40.8 KB 
ID:	10981  
    Last edited by Daniil; May 14, 2014 at 3:32 PM. Reason: [CLOSED]
  2. #2
    Hi @lasting,

    Please try:
    TokenUtils.Settings.Disable = true;
    this.Store1.DataSource = GMWeb.Utils.Helpers.RemoteOperationsHelper.GetValues(e, Data.ToList());
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @lasting,

    Please try:
    TokenUtils.Settings.Disable = true;
    this.Store1.DataSource = GMWeb.Utils.Helpers.RemoteOperationsHelper.GetValues(e, Data.ToList());
    I tried like mentioned above and the error did not appear anymore, but neither the data. I also tried setting just the SelectParsingDisable property and the result was the same, as seen in the print screen below.

    Click image for larger version. 

Name:	Untitled.png 
Views:	25 
Size:	13.0 KB 
ID:	11001
  4. #4
    I guess you need to use <ext:ArrayReader> instead of <ext:JsonReader>.
  5. #5
    Quote Originally Posted by Daniil View Post
    I guess you need to use <ext:ArrayReader> instead of <ext:JsonReader>.
    Yeah, using ArrayReader and setting
    TokenUtils.Settings.SelectParsingDisable = true
    works.

    Thank you!

Similar Threads

  1. ComboBoxBase.Select() replace old value
    By teamsar in forum 2.x Help
    Replies: 0
    Last Post: Feb 05, 2013, 9:50 AM
  2. Replies: 4
    Last Post: Jul 28, 2011, 4:36 PM
  3. [CLOSED] Dynamic grid and store with remote paging
    By stoque in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 12, 2011, 12:36 PM
  4. Replies: 0
    Last Post: Jul 07, 2011, 8:19 PM
  5. [CLOSED] Export store (remote paging)
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 22, 2010, 12:06 PM

Tags for this Thread

Posting Permissions