[CLOSED] Syntax error in generated script when using a Template

  1. #1

    [CLOSED] Syntax error in generated script when using a Template

    I am using Ext 1.2 and assigning a DataView into a grid's rowexpander.

    This code creates the template to the dataview
                DataView _view = new DataView
                {
                    ID = "DocView_" + id,
                    StoreID = "{raw}DocStore_" + id,
                    AutoHeight= true,
                    SingleSelect=true,
                    OverClass="x-view-over",
                    TrackOver=true,
        ItemSelector="td.item-wrap"
                };
    
                _view.Template.ID = "DocTemplate-" + id;
               _view.Template.Html = "<div>This is something</div>";
    
                //important
                X.Get("row-" + id).SwallowEvent(new string[] { "click", "mousedown", "mouseup", "dblclick" }, true);
    
                this.RemoveFromCache(_view.ID);
                _view.Render("row-" + id, RenderMode.RenderTo);
                this.AddToCache(_view.ID);
    And the resulting script looks like this (with a syntax error)
    Ext.net.ResourceMgr.destroyCmp("DocView_80325");
    
    new Ext.DataView({
            id:"DocView_80325",
            renderTo:"row-80325",
            autoHeight:true,
            itemSelector:"td.item-wrap",
            overClass:"x-view-over",
            singleSelect:true,
            store:DocStore_80325,
            tpl:{DocTemplate-80325_ClientInit},trackOver:true});
    
    this.DocTemplate-80325=new Ext.net.XTemplate({
        proxyId:"DocTemplate-80325",
        html:["<div>This is something</div>"]})
    
    addToCache("DocView_80325");});
    I add some line breaks to make it easier to read.
    Notice that there is nothing between the closing ) and addToCache
    Last edited by Daniil; Nov 09, 2011 at 5:37 PM. Reason: [CLOSED]
  2. #2
    I found that removing the line _view.Template.ID caused it to work but not sure why./
  3. #3
    Hi,

    I think the reason is a "-" symbol in an id.

Similar Threads

  1. Replies: 1
    Last Post: Jan 31, 2012, 12:36 PM
  2. Replies: 17
    Last Post: Oct 12, 2011, 4:54 PM
  3. Replies: 4
    Last Post: Jan 25, 2011, 10:39 AM
  4. Replies: 14
    Last Post: Sep 30, 2010, 6:15 PM
  5. Replies: 2
    Last Post: Jul 29, 2009, 1:57 PM

Posting Permissions