Mar 02, 2012, 2:24 PM
[CLOSED] V2.0 SummaryGroups error
Hi, then change a several time the continent i retrive an error in the getPrintData function from ext dll, here the problem:
Execute the current actions:
1)Select IT from the grid, and it will appear in the form OK, the combo show "Europe"
2)Select from the combo "Oceania" e click the button save, in the grid the summary change from "Europe" to "Oceania" it's work OK
If you reselect "Europa" from the combo the summary work OK...
3)Select "America" from combobox and click save, in the grid the summary "Europa" disappears and the "Italia" is in the summary "America"..work fine
4)Reselect "Europa" from the combobox and click save...does not work now and appear the error:
Errore di run-time di Microsoft JScript: Impossibile ottenere il valore della proprietà 'name': oggetto nullo o non definito
in the code:
Aurelio
Execute the current actions:
1)Select IT from the grid, and it will appear in the form OK, the combo show "Europe"
2)Select from the combo "Oceania" e click the button save, in the grid the summary change from "Europe" to "Oceania" it's work OK
If you reselect "Europa" from the combo the summary work OK...
3)Select "America" from combobox and click save, in the grid the summary "Europa" disappears and the "Italia" is in the summary "America"..work fine
4)Reselect "Europa" from the combobox and click save...does not work now and appear the error:
Errore di run-time di Microsoft JScript: Impossibile ottenere il valore della proprietà 'name': oggetto nullo o non definito
in the code:
getPrintData: function(index){
var me = this,
columns = me.view.headerCt.getColumnsForTpl(),
i = 0,
length = columns.length,
data = [],
name = me.summaryGroups[index - 1].name,
active = me.summaryData[name],
column;
for (; i < length; ++i) {
column = columns[i];
column.gridSummaryValue = this.getColumnValue(column, active);
data.push(column);
}
return data;
},
Where is my code...page aspx:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ARWebRevolution.WebForm1" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
<ext:Store ID="Store1" runat="server" >
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="ConId">
<Fields>
<ext:ModelField Name="ConId" />
<ext:ModelField Name="ConCod" />
<ext:ModelField Name="ConDes" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Store ID="Store2" runat="server" GroupField="ConDes" >
<Model>
<ext:Model ID="Model2" runat="server" IDProperty="NazId">
<Fields>
<ext:ModelField Name="ConId" />
<ext:ModelField Name="ConDes" />
<ext:ModelField Name="NazId" />
<ext:ModelField Name="NazCod" />
<ext:ModelField Name="NazDes" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<Items>
<ext:Panel ID="PanelNazioni" runat="server" Region="West" Width="300" BodyPadding="3"
Layout="FitLayout" >
<Items>
<ext:GridPanel ID="GridPanelNazioni" runat="server" Title="Nazioni"
StoreID="Store2" >
<ColumnModel>
<Columns>
<ext:Column runat="server" ID="NazCod" DataIndex="NazCod" Align="Left" Text="Codice" Width="100" />
<ext:Column runat="server" ID="NazDes" DataIndex="NazDes" Align="Left" Width="100" Text="Nazione" />
<ext:Column runat="server" ID="ConDes" DataIndex="ConDes" Align="Left" Flex="1" Text="Continente" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelNazione" Mode="Single" runat="server">
<Listeners>
<Select Handler="enableButtonRowSelect(record);" />
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>
<View>
<ext:GridView ID="GridViewNazioni" runat="server" StripeRows="true" MarkDirty="false" />
</View>
<Features>
<ext:GroupingSummary ID="GroupingSummaryContinenti" runat="server" GroupHeaderTpl='{name} ({[values.rows.length]} {[values.rows.length > 1 ? "Nazioni":"Nazione"]})'>
</ext:GroupingSummary>
</Features>
</ext:GridPanel>
</Items>
</ext:Panel>
<ext:FormPanel ID="FormPanelNazione" runat="server" ButtonAlign="Right" Height="185"
BodyPadding="10" Padding="3" Region="Center" Title="Nazioni...">
<FieldDefaults LabelWidth="70" />
<FieldDefaults ReadOnly="false" />
<Items>
<ext:ComboBox ID="ComboBoxContinenti"
runat="server"
StoreID="Store1"
Editable="true"
DisplayField="ConDes"
ValueField="ConId"
TypeAhead="true"
QueryMode="Local"
ForceSelection="true"
EmptyText="Select a state..."
SelectOnFocus="true" ReadOnly="false">
</ext:ComboBox>
<ext:TextField ID="txtNazCod" runat="server" Width="180" AllowBlank="false"
BlankText="*Obbligatorio" MaxLength="4" MaxLengthText="*Lunghezza massima 4 caratteri."
FieldLabel="Codice" Name="NazCod" FieldCls="txtObbligatorio">
<ToolTips>
<ext:ToolTip ID="ToolTipNazCod" runat="server" Title="Codice" Html="Codice della nazione">
</ext:ToolTip>
</ToolTips>
</ext:TextField>
<ext:TextField ID="txtNazDes" runat="server" AnchorHorizontal="100%" AllowBlank="false"
BlankText="*Obbligatoria" MaxLength="50" MaxLengthText="*Lunghezza massima 50 caratteri."
FieldLabel="Nazione" Name="NazDes" FieldCls="txtObbligatorio">
<ToolTips>
<ext:ToolTip ID="ToolTipNazDes" runat="server" Title="Continente" Html="Descrizione dela nazione" />
</ToolTips>
</ext:TextField>
<ext:DisplayField runat="server" ID="dspConDes" Name="ConDes"></ext:DisplayField>
</Items>
<Buttons>
<ext:Button runat="server" Text="Save" Icon="Disk">
<DirectEvents>
<Click OnEvent="Save">
<ExtraParams>
<ext:Parameter Name="NazId" Value="#{GridPanelNazioni}.getSelectionModel().getLastSelected().get('NazId')" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:FormPanel>
</Items>
</ext:Viewport>
<script type="text/javascript">
//Carica il record dalla griglia nella form e abilita i button.
function enableButtonRowSelect(record) {
if (record != null) {
App.FormPanelNazione.getForm().loadRecord(record);
App.FormPanelNazione.setTitle(record.data["NazDes"]);
App.ComboBoxContinenti.setValue(record.data["ConId"]);
};
};
</script>
</form>
</body>
</html>
Code page: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 ARWebRevolution
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Store1.DataSource = new object[]
{
new object[] { "1", "Eu", "Europa" },
new object[] { "2", "As", "Asia" },
new object[] { "3", "Oc", "Oceania" },
new object[] { "4", "Am", "America" }
};
Store1.DataBind();
Store2.DataSource = new object[]
{
new object[] { "1","Europa","1","IT", "Italia" },
new object[] { "2","Asia" ,"2", "CN", "Cina" },
new object[] { "4","America" ,"3", "CA", "California" }
};
}
protected void Save (object sender, DirectEventArgs e)
{
dspConDes.Text = ComboBoxContinenti.SelectedItem.Text;
FormPanelNazione.UpdateRecord();
Store2.GetById(e.ExtraParams["NazId"]).Commit();
Store2.Group("ConDes");
}
}
}
tanks for the helpAurelio
Last edited by Daniil; Mar 07, 2012 at 8:24 PM.
Reason: [CLOSED]