Mar 09, 2010, 6:57 AM
[1.0] Problem with Bool-Typecasting in XmlReader
Hello,
we are near to finish our upgrade from 0.82 to 1.0.
During that update I just had a little problem with the following lines ..
But all in all marking the rows if ChangedToday= true worked fine in Coolite 0.82.
Now it does not work anymore in that way. Because my solution is too diffcult to show here, I tried to make a simple example which uses a JSONReader. But this example worked fine too.
So I think the problem is somewhere in the XmlReader and the typcasting to a bool.
I can only guess but If I guess I would say the ChangedToday column is still a string (not a bool) also when I cast it in the RecordField, because when I change my code to:
everything runs fine.
Regards,
Martin
we are near to finish our upgrade from 0.82 to 1.0.
During that update I just had a little problem with the following lines ..
function markRow(record) {
if (record.data.ChangedToday) {
return 'changed-row';
}
}
<ext:Store runat="server" ID="BookingListStore" AutoLoad="true" GroupField="Date">
<Reader>
<ext:XmlReader Record="BookingOverviewEntry" IDPath="DateId">
<Fields>
<ext:RecordField Name="DateId" Type="Int" />
<ext:RecordField Name="TicketNumber" Type="String" />
<ext:RecordField Name="Date" Type="Date" />
<ext:RecordField Name="StartTime" Type="String" />
<ext:RecordField Name="EndTime" Type="String" />
<ext:RecordField Name="Status" Type="String" />
<ext:RecordField Name="RoomAnnotation" Type="String" />
<ext:RecordField Name="Topic" Type="String" />
<ext:RecordField Name="Participants" Type="Int" />
<ext:RecordField Name="Annotation" Type="String" />
<ext:RecordField Name="BeverageUrl" Type="String" />
<ext:RecordField Name="CateringUrl" Type="String" />
<ext:RecordField Name="ChangedToday" Type="Boolean"/>
<ext:RecordField Name="CateringStatus" Type="int" />
<ext:RecordField Name="BeverageStatus" Type="int" />
</Fields>
</ext:XmlReader>
</Reader>
</ext:Store>
// grid...
<View>
<ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" ShowGroupName="true"
EnableNoGroups="true" HideGroupedColumn="true">
<GetRowClass Fn="markRow" />
</ext:GroupingView>
</View>
It´s a bit complicated to show a whole simple example because I am defining the DataSource as WebService in codebehind and so on.But all in all marking the rows if ChangedToday= true worked fine in Coolite 0.82.
Now it does not work anymore in that way. Because my solution is too diffcult to show here, I tried to make a simple example which uses a JSONReader. But this example worked fine too.
So I think the problem is somewhere in the XmlReader and the typcasting to a bool.
I can only guess but If I guess I would say the ChangedToday column is still a string (not a bool) also when I cast it in the RecordField, because when I change my code to:
function markRow(record) {
if (record.data.ChangedToday=='true') { // instead of if (record.data.ChangedToday) { which worked in 0.82
return 'changed-row';
}
}
everything runs fine.
Regards,
Martin