-
9 Feb 2009 9:15 PM #1
loading combo from database
loading combo from database
hello every one!
i want to load a combo box from data base. please help me
thanks
Last edited by mystix; 9 Feb 2009 at 9:18 PM. Reason: moved to 2.x Help from Examples
-
9 Feb 2009 9:47 PM #2
U can use a JasonStore like you do for grid, you will also need to create a record object, specify fields etc ...
-
9 Feb 2009 10:11 PM #3
maybe this helps?
Code:myStore = new Ext.data.JsonStore({ url: 'urlToYourServer', autoLoad : true, root: 'yourJsonRootElement', fields:[ {name: "yourKeyField", type: "string"}, {name: "yourValueField", type: "string"} ]}); myCombo = new Ext.form.ComboBox({ title: 'yourTitle', width: 390, allowBlank: 'true', readOnly: true, triggerAction: 'all', store: yourStore, valueField: 'yourValueField', displayField : 'yourKeyField' });
-
11 Feb 2009 9:57 PM #4
help again
help again
thanks for your reply but .....
you have told me that what will be happen in Js file.. please tell me what is the format of building array in php file....
thanks
-
11 Feb 2009 10:00 PM #5
use json_encode function to output your populated array. When you fetch your records, they are stored as an array of objects or array of arrays in php. json_encode will format the output that will be readable by Ext component at the client side
-
11 Feb 2009 10:00 PM #6
You may want to post in php forums, that question is a bit out of scope for this forum.
That said, you might want to check out the tutorials in the wiki, there are few dealing with php. You're going to be sending everything to client using XML or JSON so it's really a matter of you learning how to send one of those data formats from your backend language.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
11 Feb 2009 10:01 PM #7
Also check the demos in your SDK, there are php files in there also!
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow


Reply With Quote