Nov 04, 2011, 11:15 PM
[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
Notice that there is nothing between the closing ) and addToCache
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]