[1.0] CustomConfig produces error

  1. #1

    [1.0] CustomConfig produces error

    Hallo,

    I covered a bug where invalid JS is generated. If you specify a ConfigItem with an empty value (String.Empty), JS misses a semicolon.

    Steps to reproduce:
    - Place a Grid Panel onto an empty web page.
    - Insert code behind:
    protected void Page_Load(object sender, EventArgs e)
    {
        this.GridPanel1.Store.Add(new Store());
    
        Column column = new Column();
        column.ColumnID = "Column 1";
        column.CustomConfig.Add(new ConfigItem("Test", ""));
    
        this.GridPanel1.ColumnModel.Columns.Add(column);
    }
  2. #2
    Hi,

    It is not bug. You have to use ParameterMode.Value in your case
    column.CustomConfig.Add(new ConfigItem("Test", "", ParameterMode.Value));
  3. #3
    Yes maybe, but why is the generated JS this:
    { Key : "test", Value : }
    shouldn't it be Value : undefined or something, regardless which ParameterMode is set.
  4. #4
    Hi,

    Default mode for CustomConfig is Raw, it means that the value will be rendered as is (as you provided, no transformation).
    Value mode means that the value will be wrapped by quotes
  5. #5
    We're looking into this. I agree that script should not render with a syntax error.

    In this case, probably should render as : "", even if Mode is Raw.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 5
    Last Post: Nov 26, 2012, 2:33 PM
  2. Replies: 9
    Last Post: Jul 18, 2011, 6:55 AM
  3. Replies: 8
    Last Post: May 30, 2011, 5:55 PM
  4. Replies: 1
    Last Post: Jun 26, 2010, 8:09 PM
  5. How to use the CustomConfig
    By heysol in forum 1.x Help
    Replies: 1
    Last Post: Nov 10, 2008, 8:04 PM

Posting Permissions