Is there any way to create a field with checkbox options? I can't seem to find anything on how to do that. I need to create a field that has predefined options where the user can select more than one of those options. Thanks!
You mean like a "checkbox group" feature, where your template would have something like an array of resulting items.
At the moment there is no predefined way of doing this. You could either create a bunch of checkboxes, or you could use an entity list. The UI may not be what you want, in which case you could create your own UI control to do that.
http://2sxc.org/en/blog/post/custom-input-type-advanced-dynamic-data
Related
I want to create a JavaFx LineChart able to display data from entity class dynamically selected by the user through a combobox.
Since the number of entity and their attributes is big and could be change, I want to create this process in a flexible way without hardcode the combobox filling and a switch case state to select the proper get method.
Any suggestions on how I can manage this two operations? I'm thinking to something like an application.properties file and the use of reflection, but I didn't find the right solution.
thanks in advance
I need to develop a Kendo grid as the one in the mockup that follow:
This is simple, but when a special value is selected in one of the select fields, a sort of sub-row must be displayed:
So, this set of 3 (or 6) fields is what I need to have on every grid row. That means I need to add other rows like this, being able to liveedit them or delete.
I'm wondering what is the best way to reach this (if possibile).
Can I simply define the whole set of fields (with sub-row) as a single grid row then split someway it using CSS or Kendo grid already support this kind of layout?
The Kendo UI grid is a widget which allows you to visualize and edit data via its table representation, KendoGrid is not best approach in my opinion.
You just need to create on kendo template, with you 3 static dropsdown's and when you click on your "special" value you will have to append your template again with other data if is needed.
Check on KendoTemplate docs.
EDIT: So you will have to use kendogrid detail (hardcoded), and use tempate to show you 3 fields I think.
Hope this help
I have a Drupal view that filters on a taxonomy field. I would like to be able to toggle the filter on/off by exposing a checkbox on the Exposed Filters form.
To illustrate the problem, say for example the Vocabulary is Fruit, and the Terms are Apples, Pears, Oranges and Lemons. I can select citrus fruit content by creating a filter that says Fruit is one of (Oranges, Lemons). Now I would like to expose the filter to allow me to choose whether or not to apply my citrus fruits filter. How can I add a checkbox to the exposed filters forms that will apply the filter when selected, and ignore the filter when no selected?
This is possible:
Add a filter on the appropriate field (term reference to Fruits in
your example).
In the Configure filter criterion dialog:
Set 'Filter type to expose' to 'Grouped filters'.
Check "Allow multiple selections"
Set 'Widget Type' to Radios.
You probably want to empty 'Label'.
Remove all but one of the filter sets in the table below.
In that remaining filter set:
Fill in the label ('Citrus fruits' in your example).
Set 'Operator ' to 'Is one of'.
Under Value select the values you want to filter on (Oranges and Lemons in your example).
This gives you 1 checkbox, labeled 'Citrus Fruits'. So the UI is there. Unfortunately, issue [#2224601] prevents that it works, as it results in an invalid query, but a working patch is available.
Assuming that you are using BEF and that you have checked the "Checkboxes/Radio buttons" option for your exposed filter in the BEF options, the way to set check boxes instead of radio buttons is to check "Allow multiple selections" in the configuration dialogue for your exposed filter in Views.
I think no answer here answers the question.
"What I want is to display a single checkbox that when checked applies/enables the filter, and when unchecked ignores/disables the filter. I don't think Better Exposed filters allows me to do that."
You dont need "Better Exposed filters" to do this.
You need to use grouped filters.
Click expose this filter to visitors
Filter type to expose: Grouped filters
Check 'Optional'
Check 'Widget type: Radios'
Check 'Allow multiple selections'
Remove/empty 'Label' if needed
In the bottom you will have few rows where you can set each one as you wish. If you want only one, remove all but one
Click Apply
This answer is very late. But I hope this helps someone.
You would assume that Views would do this out of the box. It doesn't. Use the Better Exposed Filters module -> http://drupal.org/project/better_exposed_filters
It even has nested checkboxes/radio buttons for taxonomy with hierarchy.
Here's some documentation specific to what you're trying to do...
"Checkboxes/Radio buttons: This option is available for any filter that has a limited number of options. Tick the Force single option to use radio buttons, untick it for checkboxes.
Nested Checkboxes/Radio Buttons: While this option shows for any filter that the regular checkboxes option shows for, it's really only of use for taxonomy filters with hierarchy. If you're using a taxomomy filter with Selection type set to Dropdown and Show hierarchy in dropdown ticked, these filters will be rendered as nested, unordered lists. Tick the Force single option to use nested radio buttons"
I've a problem with Drupal Views. My requirement is to add a custom select box in exposed filters.This select box contains some field names (the names of the fields in the views sort criteria), and when i select a value in this list, I must get the result in sorted order based on the selected value in the select box.
How can I do this?
Thanks in advance for your help
I think the easiest way is to set the view style to table. Then for the table style options you can specify which columns (fields) can be used for sorting and you can define a default sorting field. As a bonus you can set AJAX to yes, so the sorting of the table doesn't trigger the page reload.
To situate things I am working on a translation utility with a datagrid having 3 columns : translation code, reference text and target text.
The DataGrid's dataProvider property is bound to an ArrayCollection instance. The user can edit the grid and on a successful edit, the underlying collection is updated using the setItemAt() method. The collection also has a filter function to make it easier to find certain texts.
When the user clicks the 'apply filter' button the filter function is updated. This works well. The problem I have is that rows are hidden as soon as the underlying collection item change in a way that doesn't comply with the filter. The row is hidden immediately, which is not very user friendly. Rows should only hide (or be shown) when the 'apply filter' button is pressed.
I'm searching for a way to make this happen.
I assume you mean that the DataGrid's dataProvider is bound to an ArrayCollection instance?
Anyway, if you want to filter the DataGrid's dataProvider then that will remove rows from the DataGrid. You can remove the filter to add them back in. Something, conceptually like this:
collection.filterFunction = null;
collection.refresh();
If you are using the dataProvider as a source for multiple components, you can keep the filtering separate by using a different ListCollectionView for each one, but with the same source. Something like this:
component1.dataProvider = ListCollectionView(mySource);
component1.dataProvider = ListCollectionView(mySource);
Now applying a filter to one dataProvider will not affect the other.
If this doesn't help, you'll need to expand on the issue you're having and perhaps provide sample code.
After asking and looking around, I determine that there is no real way to do this. I did solve my problem however, by doing the filtering myself and only keeping a list of 'primary keys'. I then use that list to filter the collection.
The result is that rows can't suddenly disappear when records are changed, which is what I wanted.