1. import bb.cascades 1.0
  2. import bb.data 1.0
  3. NavigationPane {
  4. property variant menu;
  5. Menu.definition: menu
  6. id: nav
  7. Page {
  8. id: recipeListPage
  9. Container {
  10. id:cont
  11. layout: StackLayout {
  12. }
  13. Container{
  14. layout: StackLayout {
  15. }
  16. TextField {
  17. hintText: "Busque su receta "
  18. horizontalAlignment: HorizontalAlignment.Left
  19. input.submitKey: SubmitKey.Search
  20. }
  21. }
  22. /*
  23. ImageView {
  24. imageSource: "asset:///images/Book_background.amd"
  25. verticalAlignment: VerticalAlignment.Fill
  26. horizontalAlignment: HorizontalAlignment.Fill
  27. }*/
  28. Container {
  29. topPadding: 15
  30. bottomPadding: topPadding
  31. ListView {
  32. id: listview
  33. dataModel: groupDataModel
  34. listItemComponents: [
  35. ListItemComponent {
  36. type: "item"
  37. Container {
  38. Label {
  39. text: ListItemData.title
  40. }
  41. Divider {
  42. }
  43. }
  44. }]
  45. onTriggered: {
  46. //cont.background = Color.Cyan
  47. var pagina = pagina2.createObject();
  48. var chosenItem = dataModel.data(indexPath)
  49. pagina.nombreIngresado = chosenItem.title
  50. pagina.desIngresado = chosenItem.description
  51. pagina.dateIngresado = chosenItem.pubDate
  52. //pagina.imgIngresado = chosenItem.image
  53. nav.push(pagina)
  54. }
  55. } // ListView
  56. }
  57. // Container
  58. } // Container
  59. attachedObjects: [
  60. GroupDataModel {
  61. id: groupDataModel
  62. grouping: ItemGrouping.None
  63. sortingKeys: [ "pubDate" ]
  64. sortedAscending: false
  65. },
  66. DataSource {
  67. id: dataSourceYahoo
  68. source: "http://www.universoderecetas.com.ar/feed/"
  69. query: "rss/channel/item"
  70. onDataLoaded: {
  71. groupDataModel.insertList(data)
  72. }
  73. },
  74. ComponentDefinition {
  75. id: pagina2
  76. source: "pagina2.qml"
  77. },
  78. ComponentDefinition {
  79. id: cookbookMenu
  80. source: "CookbookMenu.qml"
  81. }
  82. ]
  83. onCreationCompleted: {
  84. dataSourceYahoo.load()
  85. // We want to only display in portrait-mode in this view.
  86. OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.DisplayPortrait;
  87. // Create the app menu for the cookbook.
  88. menu = cookbookMenu.createObject();
  89. }
  90. } // Page
  91. }//NavigationPane
Comments powered by Disqus