granjith
9 Jan 2012, 1:08 AM
Hi,
I am using Sencha Touch 1.1.
My requirement is to load NestedList from xml data. I have tried by creating a model and store as shown below
Ext.regModel('ListItem', {
fields: [{name: 'name', type: 'string'}]
});
var nestedListStore = new Ext.data.TreeStore({
model: 'ListItem',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'http://inblr-portal01/BallyBITest/dashboard.asmx/GetAvailableViews',
reader: {
type: 'tree',
root: 'objects',
record: 'objects'
}
}
});
The structure of the xml looks like this:
<objects>
<DashboardReports Name="Dashboard Views">
<Folder Name="Marketing" Path="/Dashboard/Marketing" isLoaded="false" isBranch="true">
<Folder Name="Charts" Path="/Dashboard/Marketing/Charts" isLoaded="false" isBranch="true">
<Report Name="15 Day Offer Margin" Path="/Dashboard/Marketing/Charts/15 Day Offer Margin" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/15 Day Offer Margin&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
<Report Name="Daily Offer ROI By Marketing Event" Path="/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Event" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Event&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
<Report Name="Daily Offer ROI By Marketing Segment" Path="/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Segment" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Segment&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
<Report Name="Daily Offer ROI By Player Club" Path="/Dashboard/Marketing/Charts/Daily Offer ROI By Player Club" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/Daily Offer ROI By Player Club&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
</Folder>
<Folder Name="KPIs - 3 State" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State" isLoaded="false" isBranch="true">
<Report Name="Rating Monthly Actual Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Actual Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Actual Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
<Report Name="Rating Monthly Theoretical Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Theoretical Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Theoretical Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
<Report Name="Rating Weekly Actual Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Actual Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Actual Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
<Report Name="Rating Weekly Theoretical Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Theoretical Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Theoretical Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
</Folder>
</Folder>
</DashboardReports>
</objects>
Nested List need to be loaded with "Name" attribute of each and every element in the xml.
Can anyone please help me in achieving this.
Regards
Ranjith.G
I am using Sencha Touch 1.1.
My requirement is to load NestedList from xml data. I have tried by creating a model and store as shown below
Ext.regModel('ListItem', {
fields: [{name: 'name', type: 'string'}]
});
var nestedListStore = new Ext.data.TreeStore({
model: 'ListItem',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'http://inblr-portal01/BallyBITest/dashboard.asmx/GetAvailableViews',
reader: {
type: 'tree',
root: 'objects',
record: 'objects'
}
}
});
The structure of the xml looks like this:
<objects>
<DashboardReports Name="Dashboard Views">
<Folder Name="Marketing" Path="/Dashboard/Marketing" isLoaded="false" isBranch="true">
<Folder Name="Charts" Path="/Dashboard/Marketing/Charts" isLoaded="false" isBranch="true">
<Report Name="15 Day Offer Margin" Path="/Dashboard/Marketing/Charts/15 Day Offer Margin" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/15 Day Offer Margin&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
<Report Name="Daily Offer ROI By Marketing Event" Path="/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Event" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Event&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
<Report Name="Daily Offer ROI By Marketing Segment" Path="/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Segment" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/Daily Offer ROI By Marketing Segment&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
<Report Name="Daily Offer ROI By Player Club" Path="/Dashboard/Marketing/Charts/Daily Offer ROI By Player Club" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Marketing/Charts/Daily Offer ROI By Player Club&rs:Command=Render&rc:Toolbar=true" ViewType="Charts" isBranch="false" />
</Folder>
<Folder Name="KPIs - 3 State" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State" isLoaded="false" isBranch="true">
<Report Name="Rating Monthly Actual Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Actual Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Actual Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
<Report Name="Rating Monthly Theoretical Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Theoretical Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Monthly Theoretical Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
<Report Name="Rating Weekly Actual Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Actual Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Actual Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
<Report Name="Rating Weekly Theoretical Win Per Location" Path="/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Theoretical Win Per Location" isLoaded="false" DataSource="http://inblr-portal01/ReportServer_BI?/Dashboard/Player Tracking/Comp and Point Player Tracking/KPIs - 3 State/Rating Weekly Theoretical Win Per Location&rs:Command=Render&rc:Toolbar=true" ViewType="KPIs - 3 State" isBranch="false" />
</Folder>
</Folder>
</DashboardReports>
</objects>
Nested List need to be loaded with "Name" attribute of each and every element in the xml.
Can anyone please help me in achieving this.
Regards
Ranjith.G