Results 1 to 2 of 2

Thread: Hide Checkboxes in Picker / Listing

  1. #1
    New user
    Join Date
    08-30-11.
    Posts
    5

    Reden Hide Checkboxes in Picker / Listing

    Hello everyone!
    I started writing my first more complex extension and it's going pretty well. There's just one thing I can't get around, it seems.

    I want to hide some of the selection boxes when the user edits multiple entries. There's a field in my database that is either 1 or 0 and depending on that, the box should be shown (1) or hidden (0). I tried duck-taping a solution using the search field but sadly, I can't see a way to modify the search value while the DCA is being processed. Before, I had the hopes of finding a similar function to paste_button_callback but there's none.

    On the left: What it looks like now. On the right: What it should ideally look like.






    Thank you in advance!
    Last edited by ProudOne; 12/29/2014 at 23:26.

  2. #2
    New user
    Join Date
    08-30-11.
    Posts
    5

    Default The hacky solution.

    So after playing around with the search field idea a little longer I realized that I could simply alter the Session depending on a GET flag in the DCA's OnLoad like so:

    PHP Code:
    // check GET-Flag, change the session to display only allowed items
    $arr_SearchNew $this -> arrObjects['Session'] -> get('search');

    if(isset(
    $_GET['t']))
    {
        
    $arr_SearchNew['tl_collected_headers']['value'] = ID_ONE;
    } else {
        
    $arr_SearchNew['tl_collected_headers']['value'] = ID_TWO;
    }
    // Set the field name used in the search
    $arr_SearchNew['tl_collected_headers']['field'] = 'fieldName';

    $this -> arrObjects['Session'] -> set('search'$arr_SearchNew); 
    As a peculiarity, I had to change the 0 fields in the database to 2, otherwise the search would not be executed.
    This way of doing things removes the tree structure of course - It's a hacky solution, what'dya expect?!
    Hope that helps anyone with the same problem.
    Last edited by ProudOne; 12/30/2014 at 02:43.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •