-
VeCrea
-
-
Offline
-
Platinum Member
-
-
Absolute JCook fan
-
Posts: 473
-
Thank you received: 100
-
-
-
-
|
admin wrote: So I don't know.
It is in your hands. You will find.
Dump is your friend
Table > store() is the last call before the physical write in DB.
Well, if you don't know, how could I...
looks like $city is empty at the time it looks for the country name. But it's saved in db, if i edit this item again, then it finds the $city and can find back the $country.
|
Please Log in or Create an account to join the conversation.
|
-
JoomGuy
-
Topic Author
-
Offline
-
Moderator
-
-
Joomla Enthusiast, Lover of Cooking
-
Posts: 1115
-
Thank you received: 195
-
-
-
-
-
|
Can't you filter by both...?
Do you mean a filter a grid or in a specific function?
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
|
Please Log in or Create an account to join the conversation.
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
-
Posts: 3711
-
Thank you received: 986
-
-
-
-
|
You will be able to filter directly by country very soon, once I've finished to implement better filters on different levels.
A detail
In the model, you can write in save(), but it is not the best.
The function in the MODEL is : prepareTable() Where the wizard are written.
This is why it has been confused with prepareQuery()
Now I understand ... I am very tired...
Coding is now a piece of cake
|
Please Log in or Create an account to join the conversation.
|
-
VeCrea
-
-
Offline
-
Platinum Member
-
-
Absolute JCook fan
-
Posts: 473
-
Thank you received: 100
-
-
-
-
|
a grid.
No i can't filter on country as country is not saved
|
Please Log in or Create an account to join the conversation.
|
-
VeCrea
-
-
Offline
-
Platinum Member
-
-
Absolute JCook fan
-
Posts: 473
-
Thank you received: 100
-
-
-
-
|
admin wrote: You will be able to filter directly by country very soon, once I've finished to implement better filters on different levels.
A detail, I am very tired...
In the model, you can write in save(), but it is not the best.
The function in the MODEL is : prepareTable() Where the wizard are written.
This is why it has been confused with prepareQuery()
Now I understand
I use the "store" function in tables, not the prepareTable in model, which doens't even exist here, because i chose to put automatisms in Table
|
Please Log in or Create an account to join the conversation.
|
-
JoomGuy
-
Topic Author
-
Offline
-
Moderator
-
-
Joomla Enthusiast, Lover of Cooking
-
Posts: 1115
-
Thank you received: 195
-
-
-
-
-
|
Just to check if I'm understanding correctly...
I have tables: countries & counties (states)
Countries have a name
Counties have a name and a country
I also then have a clients table with a county field... When new records are created here, I filter the counties on Countries using ajax checkbox in the options. Also, in the grid combo filter, I do the same... So, I first select a country then a county. Works perfectly...
Is this what you mean?
Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
|
Please Log in or Create an account to join the conversation.
|
-
VeCrea
-
-
Offline
-
Platinum Member
-
-
Absolute JCook fan
-
Posts: 473
-
Thank you received: 100
-
-
-
-
|
It works, but it only saves the value of county. So i can't filter on country alone, i have to choose a county too, which is not what i want to do.
|
Please Log in or Create an account to join the conversation.
|
-
JoomGuy
-
Topic Author
-
Offline
-
Moderator
-
-
Joomla Enthusiast, Lover of Cooking
-
Posts: 1115
-
Thank you received: 195
-
-
-
-
-
|
Ahhhh, right, I get it...
Isn't there an option to submit after each group in the ajax filters? Sure, I understand that this would still produce a city combo in your case but, that doesn't matter does it?
I mean, in the first select, results would be filtered by country???
Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
|
Please Log in or Create an account to join the conversation.
|
-
VeCrea
-
-
Offline
-
Platinum Member
-
-
Absolute JCook fan
-
Posts: 473
-
Thank you received: 100
-
-
-
-
|
Last time i checked on this, it wasn't functional (three weeks ago if i remember ok)
|
Please Log in or Create an account to join the conversation.
|
-
JoomGuy
-
Topic Author
-
Offline
-
Moderator
-
-
Joomla Enthusiast, Lover of Cooking
-
Posts: 1115
-
Thank you received: 195
-
-
-
-
-
|
I'm sure I had it working...
Hold on I'll check now
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
|
Please Log in or Create an account to join the conversation.
|
-
JoomGuy
-
Topic Author
-
Offline
-
Moderator
-
-
Joomla Enthusiast, Lover of Cooking
-
Posts: 1115
-
Thank you received: 195
-
-
-
-
-
|
You're right, it doesn't work...
Theoretically speaking, this should be as easy as making sure that the right joins are in place to travers back up to your country. Practically speaking, I'm not sure how to do this as I've not dug into the code for the ajax combo.
That said, I think that this is something that would be better changed at the core of the combo code as opposed to in any of your component's classes.
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
|
Please Log in or Create an account to join the conversation.
|
-
VeCrea
-
-
Offline
-
Platinum Member
-
-
Absolute JCook fan
-
Posts: 473
-
Thank you received: 100
-
-
-
-
|
Well, the thing is urgent so, even if it is not elegant, even if it's not the best solution, i would like to get back to my initial request : i want to be able to save the country in another field, but it doesn't work for some reason.
|
Please Log in or Create an account to join the conversation.
|
-
JoomGuy
-
Topic Author
-
Offline
-
Moderator
-
-
Joomla Enthusiast, Lover of Cooking
-
Posts: 1115
-
Thank you received: 195
-
-
-
-
-
|
OK so,
When i CREATE the new item, it doesn't work. If i save the item, then i edit it, then i save it again, then it works and the country appears. Can't figure out why.
In the save function, shouldn't you target the city value with $data->city as opposed to $this?
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
|
Please Log in or Create an account to join the conversation.
|
-
VeCrea
-
-
Offline
-
Platinum Member
-
-
Absolute JCook fan
-
Posts: 473
-
Thank you received: 100
-
-
-
-
|
I use the store function in the tables folder.
using $data->city doesn't work
|
Please Log in or Create an account to join the conversation.
|
-
JoomGuy
-
Topic Author
-
Offline
-
Moderator
-
-
Joomla Enthusiast, Lover of Cooking
-
Posts: 1115
-
Thank you received: 195
-
-
-
-
-
|
OK... Try this:
$maDB->setQuery ("SELECT c.id FROM #__xxx_countries as c WHERE c.id = $this->city");
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
|
Please Log in or Create an account to join the conversation.
|
Time to create page: 0.100 seconds
|