PDA

View Full Version : Extjs and using multiple SQL tables



ElHupeke
5 Jun 2013, 12:46 PM
Hello,

I'm stuck with using mysql database tables. I have several tables with dependencies. How do I use them in ExtJS. I found al lot of json examples, but I'm stuck with Ext.direct API ....
I works with only one table of the MySQL database and I use the queryoperation.php file.... But what with more tables?

This is what I want to do:

table I
id, name, carid

table II
carid, nameCar

(I want to select te nameCar by the two carid's of these tables)
I have made a GRID that displays table I. I want to display the name of the car in the grid of tableI (foreign key carid to table II and get the name.
In the edit form I want to display the fields of tableI, but want to select all the cars of table II, to change the car-id field of tableI ?

I can't find any examples or documentation how to do this. Can you please help me?

Thank you!

glopes
5 Jun 2013, 1:29 PM
You will have to develop another php file with the query you need
(SELECT nameCar FROM TABLE2 A
INNER JOIN TABLE1 B ON A.CARID = B.CARID), place the return from your PHP file in a Store and display it on your grid.

ElHupeke
6 Jun 2013, 10:39 AM
Thank you glopes!

I found a big mistake in one of the API calls to get the table loaded from the store.
Now I can select a record from the grid and the name of the car is displayed in the combobox.

Thank you for your reply!