PDA

View Full Version : Question about sencha touch list component with buttons inserted



botias
12 Aug 2011, 9:40 AM
Hi everybody!!

I just started developing sencha touch applications, and I hope that somebody can answer my question.

I wrote an application with a list component according to this tutorial: http://www.sencha.com/learn/intro-to-the-list-component/

Now I want to extend this application with two buttons on the datailpanel. One button "Deutsch", one button "Englisch". What I want to do is that app shows certain data when clicking the button "Deutsch"
( in this example: Benennung: "Abraumhalde",
Synonym: "Halde, Rückstandshalde, Salzhalde",
Definition: "..." and so on (the data in the first brackets of the data file)

When clicking the button "Englisch" Iwant that the app shows the following data:
(in this example: Benennung: "Abschlag",
Synonym: "-",
Definition: "..." and so on (the data in the second brackets of the data file)

I tried this using a second detailpanel and tried the following function for the button "Englisch":

text: 'Englisch',
ui: 'button',
store: TermApp.ListStore,
onItemDisclosure: function(record) {
TermApp.detailPanel2.update(record.data);
TermApp.Viewport.setActiveItem('detailPanel2');

...but it doesn´t work really....

Attached you can find the source code for the index and the data file. I hope you can help me :)

Thank you!!

botias
14 Aug 2011, 6:02 AM
Does nobody have an idea how to make this working?