Customizable CRUD |
[eluser]Goedel[/eluser]
Because I would like to use a WHERE clause to show only selected rows and not the full table. table1 Example: id, id_table2, name, ... 1, 2, abc,... 2, 2, eee,... 3, 1, iii, .... 4, 5, iii, .... 5, 2, ttt, .... I would like to show only row 1,2 and 5 using 'WHERE id_table2="2"' Your solution ($fields[’fieldname’][’relation’] = array(’related_table’, ‘related_field’) ![]() be very usefull if I have: table2 id, code, ... 1, BOX 2, LETTER 3, A4 4, B3 5, B2 and I want to show the table1 with the 'code' value and not the id_table2 value. 1, LETTER, abc,... 2, LETTER, eee,... 3, BOX, iii, .... 4, B2, iii, .... 5, LETTER, ttt, .... But I could do the same using a complex query like: SELECT table1.id, table2.code AS table1.id_table2 FROM table1, table2 WHERE table2.id=table1.id_table2 However your solution is better :-) Using a more complex query I could even do: SELECT id, CONCAT('<a href=\"".site_url('table/show')."/', CAST(id AS CHAR), '\">', name, '</a>') AS name to obtain: 1 <a href="http://siteurl/table/show/1">Name</a> BTW I changed CRUD to accept an external query and I'm doing all this king of ugly query hacking to obtain these features that I need: 1) ability to use a WHERE clause 2) ability to show values of index to other tables 3) show hypertext link using the id of the row If you can provide all of this functionality without using an external query and with a simple interface I'll be very happy to use them! :-) P.s. Are you italian?
[eluser]gyo[/eluser]
Goedel you're right, and I'll implement fields selection in the next release, I completely agree; the "ability to show values of index to other tables" is already in progress, and you can show links in the 'options' column of the data-grid by using: Code: $settings['options'] = array('preview' => 'example/preview/<id>_<title>'); Instead of 'id' and 'title' it will be used the value for that row. I hope to release soon a new version! cheeers gyo P.S. Si anche tu? [EDIT] I just wanted to announce that from the version 0.3 I'm going to change the class name to 'Gasoline'... so cool! ![]()
[eluser]Tookings[/eluser]
Nice work suashi! I needed a lightweight, simple -- and easy to modify -- CRUD for a prototype site tonight...and I was really dreading writing something from scratch, or using a heavier weight (and sometimes wonderful, depending on the application) CRUD framework. This was a quick drop-in without taking over my app, and very easy to read through and edit. Other than adding some bits to handle linked table options, I just added a new setting for custom table ID field names ($settings['id_field']). Very interested to see where this one goes!
[eluser]recoilme[/eluser]
Hi suashi I like your CRUD library very well, thank you for your job! Pls, add in crud.php at next release around line 115: if (isset($this->options)){//options may be not set if (is_array($this->options)) ...
[eluser]louis w[/eluser]
suashi, do you have the latest release of your crud? i would like to check it out.
[eluser]recoilme[/eluser]
Hi all I tiny redevelop standart scaffolding. Now its more flexible. Its Rambo scaffolding now) Screenshort topic download
[eluser]gyo[/eluser]
Thanx guys for your comments, always apreciated! I apologize to all of you if I'm not able to release a new version yet... as you already know the time is never enough! Btw I'm working on a sort of reorganization and I hope to release 0.3 (gasoline) asap, so stay tuned! @Tookings: precious note ![]() @recoilme: thanks for the note, it's around line 164 but I really don't like the way it is... maybe is going to change in the new release. Btw I'm not going to buy your product ![]() Thanks! gyo
[eluser]Gerson[/eluser]
Hi suashi! How is it going with your CRUD? Are you still working on it? I'm just starting working with CI and I was looking your CRUD code and it's really awesome. I've been trying to use it but my little experience with programming make it hard to make improvements. I'd like to know if you still working on it and if is there anything I can do to help it keep going... Thanks, Gerson.
[eluser]gyo[/eluser]
Thanks for the interest! Unfortunately I'm very busy with other projects and didn't have enough time to go on with this project, which is absolutely not dead... let's say it's sleeping ![]() This is something that I really need for the future so it will be done asap. Anyway I appreciate whatever kind of input and/or help to proceed! Byee
[eluser]Gerson[/eluser]
Sounds good! ![]() I've been doing some small improvements and I'm trying to document everything to send it to you as soon as I'm done. Last thing I've been trying is how to use the value of one field to fill another. Something "like" (Of course this lines of code are not going to work anyways, just to give you an idea of what I'm trying to accomplish): $fields['permalink']['type'] = 'hidden'; $fields['permalink']['value'] = url_title($fields['title']['value']); But I'm not getting any success with any of the many different approaches I've been trying. Any suggestion of how I could get this result? Thanks suashi and everyone else. |
Welcome Guest, Not a member yet? Register Sign In |