hi all, i am getting the store values from this json
JSON
Code:
{"data":[{"number":"24","question":"iPhone virtual keyboard can accommodate how many languages","option1":"21 languages","option2":"25 languages","option3":"19 languages","option4":"31 languages","answer": "21 languages"},{"number":"2","question":"How can you attach multiple pictures to an email","option1":"Not possible","option2":"Load them to the PC and send from there","option3":"Share button in Camera","option4":"Attach them one by one","answer": "Share button in Camera"}
]}
Data Model and Store and Loading into store that json values
Code:
Ext.regModel('question1', {
fields: ['number','question','option1','option2','option3','option4','answer'],
});
associatefinder.question1=new Ext.data.Store({
model:"question1"
});
Ext.Ajax.request({
url: name,
success: function(response, request) {
data = Ext.decode(response.responseText);
var stores=Ext.getStore(associatefinder.question1);
stores.loadData(data.data);
}
});
by using ajax request am gettting and storing in my question store with two values in it,
Now the problem is if i want to display only one value from that store,
for that what i have to do
code for displaying is
Code:
{
la
xtype: 'dataview',
tpl: [
'<table class=infoview>',
'<tpl for=".">',
'<tr><td class=infoview>1. {question} ?</td></tr>',
'<tr><td class=right>{option1}</td></tr>',
'<tr><td class=right>{option2}</td></tr>',
'<tr><td class=right>{option3}</td></tr>',
'<tr><td class=right >{option4}</td></tr>',
'</tpl>',
'</table>',
],
styleHtmlContent: true,
store: associatefinder.question1,
itemSelector: 'td.right',}}}
Here i should get only one question..what i have to do for that.