PDA

View Full Version : rsJSON = myDB.query(SQL, {json:true})



fairport
18 Jun 2011, 10:04 PM
Hi All
1stly: Sencha is a brain stretch for me. So thanks to all those who have helped others in this forum!

I want to connect to an MS Access db on my site, load the data (using a query) into a JSON store, then dynamically create list items.

I am ok with the "dynamically create list items" but ...

Has someone got some clues for me:
I have read that I can load a JSON Store like this

var myDB = new ACCESSdb("/Downloads/data/Knowledge.mdb", {showErrors:true});
var SQL = "SELECT * FROM FAQ";
var resultSet = myDB.query(SQL);
var rsJSON = myDB.query(SQL, {json:true});

Assuming that works (and I have defined a MODEL) ... How do I then correctly describe this store in Sencha

stores.FAQStore = new Ext.data.Store({
id: 'stores-faqstore',
model: 'models.FAQModel',
autoLoad: true,
?????
?????
?????
}
});

THX
Roger

fairport
18 Jun 2011, 10:42 PM
is it as simple as ...

stores.FAQStore = new Ext.data.Store({
id: 'stores-faqstore',
model: 'models.FAQModel',
autoLoad: true,
data: rsJSON
});

???