Customize list view in modal window

Status
Not open for further replies.

startpoint

Active Member
Hi,
I have databasejoin element with front-end select enabled and set where contition.
How to filter list in modal window based on this where condition?
How to hide some columns?
How to set css style only for this modal window?
 
Unfortunately there's no built in way to apply a 'where' filter form a join element to the 'front end select' view. I know, I've tried to make it happen, but there's just no way of automatically "translating" the clause from the element, into a list 'where'. Depending on your where clause, it may be possible to apply it with a pre-filter on a copy of the list.

Have you examined the modal window's CSS structure? You should be able to use a normal custom list CSS.

-- hugh
 
About list filter: I decided to do it by changing link with jquery that open modal window: added to url &tablename___elementname_raw='value'.

css stiling: modal div have id tablename___elementname-popupwin-select. That is enough.

And how to hide some columns?
Again with css?

Regards
 
Last edited:
About list filter: I decided to do it by changing link with jquery that open modal window: added to url &tablename___elementname_raw='value'.

css stiling: modal div have id tablename___elementname-popupwin-select. That is enough.

And how to hide some columns?
Again with css?

Regards

Yes, unless you copy the list, use that copy for the pop up, and set elements accordingly on that copy.

You can probably detect if it's a modal by checking to see if the format query string arg is set to "partial".
 
This is my decision:
Filter List View in modal window I decided not to use javascript.
I set list pre-filter with field equals to value from $_POST:
PHP:
$windowID= $_POST['fabrik_window_id'];
if (strpos($windowID, 'where_value1')){
  return 'where_value1' ;
}
if (strpos($windowID, 'where_value2')){
  return 'where_value2' ;
}
For menu list navigation I changed my template. I check if $_POST['fabrik_window_id'] is empty.
PHP:
if ($this->showAdd && empty($windowID)) :?>

   <li><a class="addbutton addRecord" href="<?php echo $this->addRecordLink;?>">
     <?php echo FabrikHelperHTML::icon('icon-plus', $this->addLabel);?>
   </a></li>
<?php
endif;
;
Is it possible to have problems and whether it is right decision?
 
To check query string args (including fabrik_window_id), it's best to use the J! API (which ensures that values have been cleaned and sanitized).

Code:
$app = JFactory::getApplication();
$myThing = $app->input->get('query_string_thing', '');
$myFormat = $app->input->get('format', 'html');

The second arg is the default to use if the qs arg isn't there.

-- hugh
 
Thanks for the clarification.
Strangely, the code that I used to prefilter stopped working and I can not understand why.
As if to field any php or sql code does not run.
Enter only return 'where_value2' ; and the list is not filtered as before. When cleaning the filter does not appear anything as a result.
Any idea?
I use the latest official fabrik version and Joomla 3.5.1
 
In value field I enter only
PHP:
return 'where_value2' ;
and type is eval selected.
The result is empty.
Syntax think is correct. Provided 'where_value2' that it is one of the options of my element.
 
In prefilter part this is piece of code
[value] => Array
(
[0] => return 'where_value2' ;
)

[origvalue] => Array
(
[0] => return 'where_value2' ;
)
 
I've kind of lost track of what you are trying to do. Only way I could help at this point would be to take a look. Which I'd only usually do for Pro, but you've been a customer for a long time, so ... :)

Just let me know which site / list, and any details I need to test it.

-- hugh
 
Hugh, thank you for your assistance.
I think I found where the problem. The element through which I want to filter the list is the dropdown element. When I turn on the option for multiple choice then is not running php code in the pre-filter "value".
When only single choise the list is filtered properly.
I guess it's a bug that.
I have another problem: I have a link in the menu to this list. When you open the menu pre filters are not reset. I want to ignore all prefilters.
How do I fix this?

Edited:
In prefilters I enable option Overriden by menu/modules.
Iin menu link set for prefilter value $db = JFactory::getDBO(); $db->setQuery("SELECT * FROM `table_name`");
With this settings prefilters are reset.
From explanation to overriden by menu/module option I see, it is recommended not to include the option.
How can I do it without it include?
 
Last edited:
That prefilter sounds wrong.

And I'm still totally confused on what you are trying to do.

If you just need a filter which selects everything, just do ...

where
field: 'id'
condition: >
value: 0
type: text
apply to: public

-- hugh
 
Thanks for the correction about prefilter in menu link.
It's all up to experience, and mine is too small.
How to solve the problem when I enable multiple choice options in the dropdown element?
 
I don't understand the problem, as I said I'm kind of lost.

Are you trying to user a query string filter, with a multi select join?

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top