Element filter values

OndrejH

Member
This one may be too easy however I am maybe just blind and cannot find the setting.

With two filters on two elements within the table.
Can you please advice me how to make the 2nd filter values to only list/include values preselected by the 1st filtr?
(They are not CDD.)
 
Anyone? Is this hyper-simple filtering based on previous filter withou use of cdd possible? This question regurarly appears in the forum however never being answered.
 
Hi,

If your list filter is ajax refresh (as soon as you change the first dropdown), I believe the second one will only display the possible values. Your filters setup should set to show only existing values vs "all values".

If not and if you want make it dynamic, I'm afraid you'll have to use CDD or specific JS except some one else have an idea...
 
Hi Jerome,

Thank you for your advice. Unfortunately, ajax does not change the selected data for the second filter. It uses "Recorded data"* and does not provide the altered values to the filter. In other words, display rows are ok (of course) after selection on the first filter but 2nd filter values are untouched by previous action. I really do not want to create additional temporary table in the sake of using cdd.

(*When you write "selected data" you mean "Recorded Data" option on the filters setting, I guess. Next to Glogal Data and All Data options. I guess naming changed from previous Fabrik version to v 3.1)

I have not idea how and where filter picks the values for display. If so I would try to think of some short value update js script.

Getting element values after ajax refresh by using (possibly?):
Fabrik.getBlock('form_1').elements.get('tablename___elementname').getValue();

But how to provide the values to be available for 2nd filter?
 
I am trying to run JS on change at 2nd element to get new filter options however without success:

var el = $('mytable___elementvalue');
var opts = el.getChildren();
var newopts = [];
opts.each(function(opt) {
newopts.push(opt.value);
});
newopts.sort();
newopts.reverse();
el.empty();
for (var inc = 0; inc < newopts.length; inc++) {
el.adopt(new Element('option', {value: newopts[inc]}).set('text', newopts[inc]));
}

This was discussed and proposed by Rob here: http://fabrikar.com/forums/index.php?threads/default-value-for-element-filter-on-a-table-view.25250/

Do I move the right direction here?
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top