Jump to content

woof's Content

There have been 5 items by woof (Search limited from 15-August 19)

By content type

See this member's

Sort by                Order  

#13593 Reset SELECT after update in edit form

Posted by woof on 06 January 2016 - 08:02 AM in I have a question

My goal is to have a SELECT with some pseudo value (not in database) to trigger something (mail) in "callback_after_update". But to avoid confusion and double action, when only "Update changes" is used (without direct "go back to list") I need to reset this SELECT to initial state when action is done and form shown again (with success message). And I really don't see how?


At first I tried to change field value in $post_array, but that obviously does not apply. So I tried JavaScript manipulation of the rendered page, but I think I have problems understanding how this can be done with jQuery and the Chosen framework (where the styled SELECT comes from). As far as I can see my SELECT has it's FALSE value, but the control still shows TRUE (and submits it). F.i. I triggered 'chosen:updated' event on the SELECT but that does not do any change.  Maybe it's about timing, but when I tried to attach 'chosen:ready' event listener to SELECT it is not called.

  • Any hints on changing SELECT value?
  • Is there a way to have a (more plain HTML) CHECKBOX instead of a SELECT in Grocery?
    (The "active"/"inactive" radio buttons from "true_false" field type don't really match and modifying Grocery code to change labels is not in my intention.)
  • Or is it possible in Grocery to reset SELECT value in earlier phase while remembering posted value somewhere else for use in "callback_after_update"?



#13509 Join Tables

Posted by woof on 16 December 2015 - 05:47 AM in I have a question

Another question on this. Is it possible to extend query used for filter in "flexigrid" theme?

#13467 Join Tables

Posted by woof on 04 December 2015 - 06:28 AM in I have a question



okay, I managed on my own, "get_edit_values()" needs some extension. I did it like this:

function get_edit_values($primary_key_value) {
    $primary_key_field = $this->get_primary_key();
    $result = $this->db->get($this->table_name)->row();
    if ($result) {
        $data = $this->db->query("SELECT ... WHERE id=" . $result->id . ";");
        foreach ($data->result() as $row) {
    return $result;

Now I just need to extend "db_update()", "db_insert()" and "db_delete()" also...

#13463 Join Tables

Posted by woof on 02 December 2015 - 09:31 PM in I have a question

Just one stupid newbie question:


I got it working joining a second tables values, and they appear in list view.


But when I open edit dialog these values are not set. Do I need to expand "get_row()" as well and how?



#13462 How to create an extension for grocery CRUD (real example included)

Posted by woof on 02 December 2015 - 09:05 PM in How to and FAQs

Sorry, wrong topic, could you please delete?