[CLOSED] Prevent {} replacement

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Prevent {} replacement

    Hi,

    I know that a curly brace is a reserved word in ext.net and you replace it

    Anyway I can prevent this and keep the {} IN both 1.7 and 2 as it causes alot of grief in certain conditions

    Thanks

    Mac
    Last edited by Daniil; Nov 29, 2013 at 2:18 PM. Reason: [CLOSED]
  2. #2
    Can you post a sample that demonstrates how to reproduce the problem?

    The curly braces themselves are not reserved characters. There are some token formats, such as #{ID_HERE} that will get parsed and replaced, but not {}.
    Last edited by geoffrey.mcgill; Nov 25, 2013 at 4:51 AM.
    Geoffrey McGill
    Founder
  3. #3
    Hi everybody,

    It is something which was requested before and we introduced some new settings in TokenUtils, in v2. For example, to prevent parsing of #{}:
    TokenUtils.Settings.IDParsingDisable = true;
  4. #4

    Example

    Here it is

    also is there any way this can be done on v 1.x ?? aswell ?

    Thanks

    Mac
    Attached Files
  5. #5
    Please post a test case as text wrapping in [CODE] tags instead of attachments. It is better to edit the existing post rather than creating a new one.
  6. #6

    Example

    Here you go

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication4.Default" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Simple Array Grid</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" Theme="Gray" />
        
        <h1>Simple Array Grid</h1>
        
        <ext:GridPanel 
            ID="GridPanel1"
            runat="server" 
            Title="Array Grid"         
            AutoHeight="True" AutoWidth="True">
            <Store>
                <ext:Store ID="Store1" runat="server">
                <Reader>
                <ext:JsonReader IDProperty="Key">
                                <Fields>
                                    <ext:RecordField Name="Key" />
                                    <ext:RecordField Name="Value" />
                                </Fields>
                            </ext:JsonReader>            
                            </Reader>
                            
                            </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column ColumnID="Key" Header="Key" DataIndex="Key" />
                    <ext:Column Header="Value" DataIndex="Value"/>                  
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
    </body>
    </html>
    code behind

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    
    namespace WebApplication4
    {
        public partial class Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    this.Store1.DataSource = this.Data;
                    this.Store1.DataBind();
                }
            }
    
            private List<PropertyItem> Data
            {
                get
                {
                    // this data does not work 
                    List<PropertyItem> items = new List<PropertyItem>();
                    items.Add(new PropertyItem() { Key = "key1", Value = "${fileName}" });
                    items.Add(new PropertyItem() { Key = "key2", Value = "value2" });
                    items.Add(new PropertyItem() { Key = "key3", Value = "#{fileName}" });
                    return items;
                }
            }
    
    
            private List<PropertyItem> DataWorks
            {
                get
                {
                    // this data does
                    List<PropertyItem> items = new List<PropertyItem>();
                    items.Add(new PropertyItem() { Key = "key1", Value = "filename" });
                    items.Add(new PropertyItem() { Key = "key2", Value = "value2" });
                    items.Add(new PropertyItem() { Key = "key3", Value = "filename2" });
                    return items;
                }
            }
        }
        public class PropertyItem
        {
    
            #region Properties
            public string Key { get; set; }
            public string Value {get; set;}
            #endregion
    
        }
    }
    Last edited by geoffrey.mcgill; Nov 25, 2013 at 12:06 PM. Reason: Please use [CODE] tags
  7. #7
    Any chance you could edit that last post and use [CODE] tags as suggested above?
    Geoffrey McGill
    Founder
  8. #8
    Hi,

    I did that - did i not do it correctly ?

    Mac
  9. #9
    You used quote tags instead of code ones.

    Also please notice that:
    Quote Originally Posted by Daniil View Post
    It is better to edit the existing post rather than creating a new one.
  10. #10
    Quote Originally Posted by macinator View Post
    Hi,

    I did that - did i not do it correctly ?

    Mac
    I replaced the [QUOTE] tags with [CODE] tags for you.
    Geoffrey McGill
    Founder
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Replacement for getActiveTab()?
    By vadym.f in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 06, 2013, 3:44 PM
  2. [CLOSED] Ext.Net.BoxComponent replacement in Ext.NET 2.1?
    By sisa in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 23, 2013, 1:51 PM
  3. Replies: 1
    Last Post: Aug 21, 2012, 7:37 AM
  4. AddLabelCls replacement
    By Zdenek in forum 2.x Help
    Replies: 2
    Last Post: Aug 16, 2012, 5:08 PM
  5. Replies: 4
    Last Post: Jul 09, 2012, 6:08 PM

Posting Permissions