Software Archive
Read-only legacy content

Parse html en una ListView

maxlinux2000
Beginner
370 Views

Hola a todos,

acabo de entrar en este mundillo porqué me encanta el XDK, sin embargo, me he topado con un problema que no consigo superar.

Estoy aprendiendo hacer un lector RSS y he conseguido crear un Service method RSS, que me saca los feeds de mi blog en wordpress, donde lo he configurado para que me de todo el texto de las Entradas, en el panel de control, 

Luego en XDK, envio los feeds a una ListView y en el Label le he pusto "{{entry.title}}"... y funciona.

Pero no me gusta nada que apretando el campo, me muestre la pagina web usando el InAppBrowser, así que estoy utiizando este metodo:

He añadido una segunda ListView de 3 bloques (la que viene por defecto)

Para sincronizar la primera lista con la segunda utilizo el indicador que se crea a conectar el ServiceMethod a la primera ListView, que en mi caso es: listitem.{{entry.title}}.selector

...y funciona también, Al pasar el dedo por los titulos de la primera ListView (solo son 5 entradas), se cambia todo el contenido de la segunda lista, según las entradas seleccionada.

Per aquí sale el problema:

Al parecer la lista (class="widget uib_w_6" data-uib="app_framework/listitem") no parsea el código html, y me muestra la entrada así como le llega.

Alguna idea de como puedo hacer?

Lo ideal sería algún comando que oblique a parsear el código dentro del widget.

saludos

MaX

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
3 Replies
Chris_P_Intel
Employee
370 Views

Creo que tenes que cambiar el HTML.  En lugar del ultimo listview, desarrolla tu propio componente en el HTML.  O, si preferis, usa el 'card' widget.  El card puede tener cinco secciones distinctos (header, footer, los dos lados, y el contento) con sub-widgets.  Adjunta el card al el service method, y pone el service method valor en un seccion ( {{entry.html}} ).

Tiene sentido?

 

Instead of a listview, develop your your HTML . Or if you prefer, use the card widget. The card supports five separate sections (header, footer, left and right sides and the main content).  You can put sub-widgets in those sections. Attach the card to the service method, then go to the HTML and insert the service method value you want.

Does that make sense?

 

0 Kudos
maxlinux2000
Beginner
370 Views

TNX Chris

I have tons of questions, but step by step the shadow is dissolving :)

I'll try with the Card widget.... but here others questions are rising....

1. can I add widget to xdk?

2. Can I activate the App designer when I import a html5 code for example a cordova or phonegap source? How?

Example: If I import to xdk this proj: https://github.com/driftyco/ionic-example-cordova-camera the AppDesigner will be off...and it's not good to my eyes.

----

Gracias Chris

Tengo un montón de preguntas pero poco a poco la niebla se va. Voy a probar con el widget de Card, pero esto me provoca me más  preguntas:

1. Se puede añadir widget a XDK? 

2. Puedo activar el AppDesigner cuando hago una importación de un código html5 de ejemplo de cordova o de phonegap...? Como?

Por ejemplo... si voy a importar este proyecto: https://github.com/driftyco/ionic-example-cordova-camera AppDesigner de queda apagado, y esto no me gusta nada.

saludos

MaX

0 Kudos
Chris_P_Intel
Employee
370 Views

1. can I add widget to xdk?

Not easily. It is something we've been planning to open up. But, regardless, it isn't trivial.  The card widget when hooked to a service will let you do a lot of what you want. 

2. Can I activate the App designer when I import a html5 code for example a cordova or phonegap source? How?

The template you mention has almost no visual components. Just an image, a header, and a button. So, while there is a way to get it into App Designer, I don't really see the point.  

Here is what you do:

a) open the project into the XDK. 

b) from the Projects pane, choose a UI framework to import it to. You can choose "Ionic". That'll bring it into App Designer and convert the components over.  But, layout and interactivity are often lost when converting projects that didn't start within App Designer. So I don't think it'll get you much.

0 Kudos
Reply