1. How to handle image files.
1a. How could I get dbEdit to give me the option of uploading an image-file for certain fields?
1b. What will it do with the files - will it store them in the database? Or will it store them in files and store the filename in the database?
(both is fine with me, but I’ll have to adjust the table definition accordingly of course).
2. How to handle foreign keys.
I use lot’s of foreign keys (all done using id’s) to different tables - and dbEdit now asks for the id to be filled in by hand, and I would like my users to work with more "real life data".
Example: "catid" is the id of the "category" table. Now when the user is adding a new product, he (or she) should indicate the right category for the product - but I would like him to be able to pick the right category by name from a dropdownlistbox or something like that.
Is it possible to do something like that (enter a "name" instead of "id" for references to other tables) with dbEdit?
And if it’s not possible: could someone give me some pointers about where I should add my own code?
When using the dbEdit as a datagrid, the data is paginated above a given number of rows in the database. Doe’s some of you know where to "turn off" that pagination?
The reason I ask is because the sorting script from my last post doesn’t work when the data in the datagrid, set up via the dbedit module, is paginated.
If I do that and click on save I get the following error:
1. How to handle image files.
Edit the configuration and set the ’format’ to "image" in the field properties. This will give you an insert image button so you can select an image using the modx image/file manager dialog.
2. How to handle foreign keys.That worked like a charm; thanks!
This should work. Again in the ’format’ column of the field properties. Set the format to something like "select@SELECT name,id from category"
Quote from: TobyL at Oct 21, 2009, 11:03 AMIf I do that and click on save I get the following error:
1. How to handle image files.
Edit the configuration and set the ’format’ to "image" in the field properties. This will give you an insert image button so you can select an image using the modx image/file manager dialog.
Unable to save configuration. Reason is:
Are there any requirements for the data type of the data column in which the filename should be stored? Or could there be a different reason for this error?
Any text type should do though.
Thanks; I had tried it with varchar, which didn’t work, but text works perfectly!
1. How to handle image files.
Edit the configuration and set the ’format’ to "image" in the field properties. This will give you an insert image button so you can select an image using the modx image/file manager dialog.
Question:
Are there any requirements for the data type of the data column in which the filename should be stored? Or could there be a different reason for this error?
Answer:
Obviously a numeric type wouldn’t work too wellAny text type should do though.
Thank you very much, it work.
Quote from: Sylvaticus at Oct 15, 2009, 08:39 AM
When using the dbEdit as a datagrid, the data is paginated above a given number of rows in the database. Doe’s some of you know where to "turn off" that pagination?
The reason I ask is because the sorting script from my last post doesn’t work when the data in the datagrid, set up via the dbedit module, is paginated.
If I remember correctly the number of records shown is determined by the "Number of Results" setting in the modx configuration (interface & features tab)...
I didn’t know about that one.