Skip to profile content
FWIW, I got this to work by doing a callbackEditField and callbackAddField to sort of get it out of GC control, and be able to id the fields as appropriate…so this was a way out of my problem, but interesting that I needed to do that to make it work.
Can we make this like grocery-crud where it doesn’t require codeigniter be installed via composer? grocery-crud will just happily install, and would like to see image-crud do the same thing…esp since CI allows for both composer and non-composer installs of it’s software too. Thanks!
Hey Johnny, Yeah, it definitely wasn’t a substantial effort to update…my biggest miss was needing to go update the view, and once I did that, it basically just worked. I have no issue with it being in composer…kind of makes sense really. Thanks, Erick
Thanks for the CSS tip. That works…a bit more complicated since I replace the View button with another View button and the titles are the same, but the concept was enough to get me to what I needed…thanks!
Thanks Johnny, will give the 2nd option a try. The 1st one didn’t work as I expected, but I can work around it with some DB views and make the issue resolved. I know at one point, you had mentioned changing the behavior of the Action buttons so that custom buttons would be listed prior to the defa…
Hey @johnny, real quick testing seems to indicate that 3.1.16 resolves my issue. I’ll test a bit more, but looks like it is resolved. Thanks! Erick
Hey Johnny, Yeah, it was strange for sure. I can share the controller, view and the table schema so you have that in an email. There’s a lot going in, and the controller code is a bit of a mess with the conversion from CI3 to CI4 and grocery crud 1.x to 3.x – so lots of stuff just commented out, …
Johnny, some more info to see if we can figure out why this isn’t working for me… I defined a new virtual field, “virtual_test”. If I do not do any callback’s, on the Edit form, I see this field listed, and a text input box is there to capture the input — exactly how I’d expect it to be. If I def…
fyi - i think i have this working in CI4, so feel free to ignore this one…thx
Hey Johnny, Yeah, I’m definitely puzzled right now. It accepts setting the field type as virtual, without any issues. It just isn’t firing on any of the callback routines, and no idea why at this point. I originally thought it was something in my syntax, but changing the table definition from th…
fyi, when I added that field as a column to the table, the callback worked exactly as expected, but without the column in the db table (just defined as a virtual field), the callback doesn’t do anything.
Hi Johnny, In working with this, I can define the fieldtype as “virtual”, and that clearly makes it valid and stops the errors that were originally happening. The only issue I’m seeing is that it doesn’t appear that the callback*Field routines are working? Something as simple as: $crud->fieldTyp…
Thanks Johnny…I’ll update and let you know how it goes. Thanks much for the quick attention to this. Erick
Thanks! That seems to fix it. I figured there was at least 1 or 2 more functions that needed to be handled, but not familiar enough with the code to just know, and hadn’t traced through it in great detail. Thanks for that. Erick
Hey Johnny, So, one way I found to do this is by using custom Action buttons… which is definitely ok…and kind of makes sense in a way…still working thru the viability of it. [UPDATE] This seems to work as I need, and I’m fine with using the setActionButtons (it actually makes sense to do so), so …
Hey Johnny, So the first thing I’m seeing is that for the “virtual” fields, the callbackEditField isn’t being honored, so the entry is “blank” on the Edit page vs what I have in that callback. Thoughts ? Erick
Hi Johnny, First off – thanks so much for the super fast response. I like “virtual” over “fake” as well. :grinning: So it seems that as long as I get $db populated and pass that to the Model($db) for initialization, that the rest of it works as expected. (using what you have for CI4 docs: $db = $this->_g…
Absolutely. If I could insert “fake” columns and/or “fake” fields, I’d be in great shape. I was hoping if I did a setFieldType on that “fake” field, that it would store that information and I wouldn’t get the dataType error…but not so lucky. :joy: Thanks! Erick
Hey Johnny, Thanks much for the note and looking into this. Perhaps a bit of misunderstanding, it’s not so much that I’m specifically looking for the 1:1 relationships. Ultimately, while I’m looking to pull in additional details for the user, I’m only looking for GroceryCrud to update the 1 table…
Hey Johnny, I was reading your response on another topic regarding the multiple fields in a 1:1 relationship – very similar to what is going on here that I need…and the suggestion of just using DB Views to get to the data. While I wasn’t exactly keen on that originally, I’m beginning to think th…