There Are Option to Choose Upload Image to dataBase/Or Select Image Form DataBase in edtior?
There Are Option to Choose Upload Image to dataBase/Or Select Image Form DataBase in edtior?
OrTurjamen
Posts: 17Questions: 2Answers: 0
i now can only upload a new image to database and to my folder, if i want to have an option to select:
upload new image or select image(and show all the images in Images table and select one of them ) how can i do this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
That's not a feature of the Editor upload field type at the moment I'm afraid. The closest to that would be to show a
select
list of the current images (orradio
list or whatever) and let the user select from them, or do an upload. If one is selected and a file uploaded, then either fail it in validation or accept one over the other.Allan
hey Allan, if i have two database, how can i show information and select data for a field in one table from another database table? its can be done?
Do you mean a join like this?
Allan
i mean that i want to get table2 data form other database
and show in option select field in table1 that from other database
this example will maybe let you understand better
Field::inst( 'db1.table1.field1' ),
Field::inst( 'db2.table1.field1 )
another question, i search post for my problem and get this answer that you wrote to other user
"The difference is that the join example doesn't insert into the joined table - only the host table (users in that example). The host table references the join.
Editor does have the ability to insert into the joined table, but only after the row in the main table has been created or updated. Correct me if I am wrong please, but it sounds like you need to insert into your joined table and then reference that from the main table. It is that first part that Editor doesn't currently support.
Allan"
its still cannot be done with the editor?
That is still the case, yes.
That's not something we've tested I'm afraid. However, if you consistently use the database.table.column naming style, I think it should work on MySQL (assuming that is your db of choice).
Allan
ok thanks allan, i try to override the create method of the editor, i used ajax and turn to other url that create the fields in tables like i want, but what i need to return to this ajax call?, because all the time when i click create i get this error?
this is my controller in server:
(```)
and this is my create ajax call:
(```)
The server to client JSON format is documented here. Happy to answer any questions you have about it.
Allan
Hey Allan, i would like to get an example for this if you can, i didnt understand how to do this from the documents!
This tech note details how you can see what the server is responding with.
Allan
Hey Allan, i have a field in database called phone, now this phone value is generated from select list of (telephone) area code and text field of the phone number
how can i can make it work with the editor?
So to confirm, you have the generated phone number, the area code list and also the local number all stored in the db? If so and the generated number never gets user input, its just created from the two other fields use a set formatter.
Allan