Mar 27, 2009, 1:34 PM
Grid rows not showing
Hi,
Before I even begin to explain, I have a similar issue to the following post: http://forums.ext.net/showthread.php?832.
On my page I have a search form that is used to filter the data that should appear in the grid. Additionally, when the page is initially loaded a selected set of data is set to the DataSource of my store.
What happens is that each time I load the data in the store there are no rows in my grid even though my PagingToolBar tells me that the correct amount of rows have been returned. Another thing I noticed using firebug is that my response has 0 for the totalCount yet the data property of the Data object (which is an array) has the correct amount of records that is being displayed in the PagingToolbar.
The only difference in my scenario is that I do not use an asp ObjectDataSource. I simply add each Object to an array list then set it to the store.DataSource and call the store.DataBind() method.
Here are some quick samples of my code:
ASPX
I'd appreciate any help I can get on this. Maybe its due to the fact that I don't use an object data source. Who knows...
Thanks
Myron
Before I even begin to explain, I have a similar issue to the following post: http://forums.ext.net/showthread.php?832.
On my page I have a search form that is used to filter the data that should appear in the grid. Additionally, when the page is initially loaded a selected set of data is set to the DataSource of my store.
What happens is that each time I load the data in the store there are no rows in my grid even though my PagingToolBar tells me that the correct amount of rows have been returned. Another thing I noticed using firebug is that my response has 0 for the totalCount yet the data property of the Data object (which is an array) has the correct amount of records that is being displayed in the PagingToolbar.
The only difference in my scenario is that I do not use an asp ObjectDataSource. I simply add each Object to an array list then set it to the store.DataSource and call the store.DataBind() method.
Here are some quick samples of my code:
ASPX
<ext:Store ID="storeGeneralSearch" runat="server"
OnRefreshData="storeGeneralSearch_RefreshData">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="CallId" />
<ext:RecordField Name="Extension" />
<ext:RecordField Name="CodeOwner" />
<ext:RecordField Name="CallDate" />
<ext:RecordField Name="CallTime" />
<ext:RecordField Name="NumberCalled" />
<ext:RecordField Name="CallDirection" />
<ext:RecordField Name="CallDuration" />
<ext:RecordField Name="CallCost" />
<ext:RecordField Name="CallDescription" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:GridPanel ID="grdGeneralSearch" runat="server" Frame="false" StoreID="storeGeneralSearch" >
<ColumnModel runat="server">
<Columns>
<ext:Column DataIndex="CallId" Hidden="true" />
<ext:Column Header="Extension" DataIndex="Extention" MenuDisabled="true" />
<ext:Column Header="Code Used/Owner" DataIndex="CodeOwner" MenuDisabled="true" />
<ext:Column Header="Date of Call" DataIndex="CallDate" MenuDisabled="true" />
<ext:Column Header="Time of Call" DataIndex="CallTime" MenuDisabled="true" />
<ext:Column Header="Dialed Number" DataIndex="NumberCalled" MenuDisabled="true" />
<ext:Column Header="Call Direction" DataIndex="CallDirection" MenuDisabled="true" />
<ext:Column Header="Duration" DataIndex="CallDuration" MenuDisabled="true" />
<ext:Column Header="Cost" DataIndex="CallCost" MenuDisabled="true" />
<ext:Column Header="Comments" DataIndex="CallDescription" MenuDisabled="true" Align="Left" />
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolBar ID="pagingToolbar" runat="server" PageSize="20" StoreID="storeGeneralSearch"
DisplayInfo="true" DisplayMsg="Displaying: {0} - {1} of {2} Calls" EmptyMsg="No call data to display" />
</BottomBar>
<LoadMask ShowMask="true" />
</ext:GridPanel>
Code Behindpublic void BindData(bool isRefreshing)
{
CallDataModelCollection collection;
if (dfStartDate.SelectedDate > DateTime.MinValue && !isRefreshing)
collection = CallDataDataClients.RetrieveGeneralSearchData(dfStartDate.SelectedDate);
else
collection = CallDataDataClients.RetrieveGeneralSearchData(DateTime.MinValue.Date);
if (collection != null)
{
storeGeneralSearch.DataSource = collection;
storeGeneralSearch.DataBind();
}
}
My response looks like this:{serviceResponse:{Data:{data:[{"CallId":10592,"CallDate":"2007-09-06T00:00:00","CallTime":"2007-09-06T16
:55:13","CodeOwner":"0","Extension":"26","NumberCalled":"14434771","CallDirection":"2","CallCost":175
,"CallDuration":null,"CallDescription":"Personal"},{"CallId":11625,"CallDate":"2007-09-18T00:00:00","CallTime"
:"2007-09-18T08:25:45","CodeOwner":"0","Extension":"30","NumberCalled":"17928724","CallDirection":"2"
,"CallCost":14,"CallDuration":null,"CallDescription":"Personal call"},{"CallId":21945,"CallDate":"2008-01-23T00
:00:00","CallTime":"1899-12-30T09:41:08","CodeOwner":null,"Extension":"29","NumberCalled":"14210662"
,"CallDirection":"2","CallCost":14,"CallDuration":null,"CallDescription":"Call to Mr. Jones"},{"CallId"
:27562,"CallDate":"2008-03-31T00:00:00","CallTime":"1899-12-30T14:32:16","CodeOwner":null,"Extension"
:"29","NumberCalled":"18621010","CallDirection":"2","CallCost":7,"CallDuration":null,"CallDescription"
:"Personal"},{"CallId":29675,"CallDate":"2008-04-21T00:00:00","CallTime":"1899-12-30T10:13:56","CodeOwner"
:null,"Extension":"21","NumberCalled":"13795758","CallDirection":"2","CallCost":7,"CallDuration":null
,"CallDescription":"PC- RH"},{"CallId":29685,"CallDate":"2008-04-21T00:00:00","CallTime":"1899-12-30T10
:26:34","CodeOwner":null,"Extension":"21","NumberCalled":"18518676","CallDirection":"2","CallCost":63
,"CallDuration":null,"CallDescription":"Personal- RH"},{"CallId":32241,"CallDate":"2008-06-06T00:00:00"
,"CallTime":"1899-12-30T07:55:47","CodeOwner":null,"Extension":"21","NumberCalled":"13978482","CallDirection"
:"2","CallCost":7,"CallDuration":null,"CallDescription":"PC-Jashua T"},{"CallId":32242,"CallDate":"2008-06-06T00
:00:00","CallTime":"1899-12-30T07:57:04","CodeOwner":null,"Extension":"21","NumberCalled":"13604280"
,"CallDirection":"2","CallCost":14,"CallDuration":null,"CallDescription":"PC-Jashua T"}], totalCount
: 0},Success:true},script:"RegularPage_grdGeneralSearch.reload();"}
I've also attached an image showing what it looks like after the grid is bound.I'd appreciate any help I can get on this. Maybe its due to the fact that I don't use an object data source. Who knows...
Thanks
Myron
Last edited by geoffrey.mcgill; Feb 20, 2011 at 12:53 PM.