Menu

column filters on an entity grid

Help
2004-10-08
2013-03-07
  • David Weinraub

    David Weinraub - 2004-10-08

    Greetings!

    [ SM v2.4.2 ]

    I have an entity grid used for editing a single row in a table of datas. Each row of the grid has a single submit button. The grid also has several column filters.

    I need to the filters to run only to the row being submitted. But on submit, the filters get applied to every row, not just the submitted row.

    The current code is (essentially) the pretty standard setup:

    // previous code has already instantiated and
    // configured the form, and the entities and filters
    // have been add()'ed.
    $form->run();

    if (!$form->dataVerified()){
       // output the form
    } else {
      // determine the row being submitted
      // do db writes, etc.
    }

    I guess the issue is that $form->run() checks the ftl flag and invokes the column filters on *all* the rows.

    Any suggestions on how to apply filters only to the row being submitted?

    Thanks!

     
    • Jonathan Michel

      Jonathan Michel - 2004-10-08

      Entity Grids have a directive to get the behavior you need. It is set to false by defauly.  Just set it to true.

      We creatively named it:

      filterSubmitRowOnly

      Hope that helps.  If you don't have that directive available please upgrade to a later version of SiteManager.

       
      • David Weinraub

        David Weinraub - 2004-10-09

        Poifect! Udaman!

        Thanks and regards,

        Dave

         

Log in to post a comment.

MongoDB Logo MongoDB