PDA

View Full Version : [CLOSED] JScript runtime error



canbay
Feb 07, 2013, 4:05 PM
5571
when i refresh the gridpanel's store ,i get this error.Waiting for your helps.
thanks.

Vladimir
Feb 07, 2013, 5:01 PM
Please provide runable test sample reproduces the issue

canbay
Feb 08, 2013, 7:26 AM
Please provide runable test sample reproduces the issue


After expanding the Gridpanel1,I press the search button.after that it getting this.component.doLayout() error.Waiting for your helps.
Thanks.



protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store1.Reload();
}
}
protected void Store1_Refresh(object sender, StoreReadDataEventArgs e)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test", "test" },
new object[] { "test", "test" },
new object[] { "test", "test" }
};
store.DataBind();
}
protected void ButtonSearch_Click(object sender, DirectEventArgs e)
{
Store1.Reload();
}
protected void Store2_Refresh(object sender, StoreReadDataEventArgs e)
{
Store store2 = this.DataView2.GetStore();
store2.DataSource = new object[]
{
new object[] { "test", "test" },
new object[] { "test", "test" },
new object[] { "test", "test" }
};
store2.DataBind();
}




<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>

.my-grid .x-grid-cell
{
border-bottom-width: 1px;
border-bottom-color: Gray;
border-bottom-style: solid;
}

div.item-wrap
{
float: left;
border: 1px solid transparent;
cursor: pointer;
text-align: center;
}
</style>
<script>
var template = '<span style="color:{0};">{1}</span>';

var getAdditionalData = function () {
var o = Ext.grid.feature.RowBody.prototype.getAdditionalDa ta.apply(this, arguments);

return Ext.apply(o, {
rowBody: '',
rowBodyCls: 'my-row-body'
});
};
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:GridPanel ID="GridPanel1" runat="server" Cls="my-grid" AnimCollapse="true" AutoScroll="true" >
<Store>
<ext:Store ID="Store1" runat="server" PageSize="3" OnReadData="Store1_Refresh">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Test 1" DataIndex="test1" />
<ext:Column ID="Column2" runat="server" Text="Test 2" DataIndex="test2" />
</Columns>
</ColumnModel>
<Features>
<ext:RowBody ID="RowBody1" runat="server">
<GetAdditionalData Fn="getAdditionalData" />
</ext:RowBody>
</Features>
<Plugins>
<ext:RowExpander ID="RowExpander" runat="server">
<Listeners>
<Expand Handler="#{Store2}.reload();" Delay="1" />
</Listeners>
<Component>
<ext:DataView ID="DataView2" runat="server" SingleSelect="true" ItemSelector="div.item-wrap"
OverClass="x-view-over">
<Store>
<ext:Store ID="Store2" runat="server" OnReadData="Store2_Refresh">
<Model>
<ext:Model ID="Model2" runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Tpl ID="Template1" runat="server">
<Html>
<div>
<tpl for=".">
<table width="80" style="border:1px solid darkblue; margin:5px; font: normal 11px/15px tahoma,arial,verdana,sans-serif; text-align: center">
<tr >
<td style="text-align: left; width: 76px;"><b>WORK CARRIED OUT :</b></td>
<td colspan="3" style="text-align: left;background:#ebf0f8;">{test1}</td>
</tr>
</table>
</tpl>
</div>
</Html>
</Tpl>
</ext:DataView>
</Component>
</ext:RowExpander>
</Plugins>
<TopBar>
<ext:Toolbar runat="server" >
<Items>
<ext:Button runat="server" ID="ButtonSearch" Icon="Find" Text="Search">
<DirectEvents>
<Click OnEvent="ButtonSearch_Click" />
</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
</ext:GridPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>

Vladimir
Feb 08, 2013, 11:23 AM
At this moment, I suggest to wrap DataView by Container (place DataView to Items collection of Container)

canbay
Feb 11, 2013, 12:23 PM
At this moment, I suggest to wrap DataView by Container (place DataView to Items collection of Container)

very thanks.its working

Vladimir
Feb 11, 2013, 11:07 PM
Hi,

Fixed in SVN