Instantsearch filter by custom function - algolia

Due to certain limitations I am not able to index categories and subcategories so I need a way to be able to filter a list of manually created items. It's actually a two part thing:
1: I am filtering the visible results via a toggle switch
2: I now have a submenu (also manually created) with multiple items which need to be sortable as well.
So when I click on any item it filters. The behavior should be the same as in this demo.
This part, to be specific:
The issue I'm facing is that I don't know if this is possible at all. Yes, I looked at the obvious places but could not find anything helpful. Again, the list is created manually so I'd need some custom function to highjack the instantsearch results, I guess.
Any help is much appreciated.

Related

how to mark/check a checkbox in Moodle

I have a lot of checkboxes and their names are generated with the help of the resource id they are associated with, which in turn is fetched from the database.
$mform->addElement('checkbox', 'incres'.$coursename.$sec->section.$record3->instance);
The second parameter is the name of the checkbox.
I need to know how to mark this checkbox as checked.I have a feeling this can be done by the setDefault method but I cant figure out how. I tried
$mform->setDefault('reqdres'.$coursename.$sec->section.$record3->instance,1);
But that doesnt work. I dont wish to use Javascript or the advancecheckbox element for this since that will require me doing a lot of changes in other dependant modules
Did you try using the Advanced Check Box? $mform->setDefault() should work with this.

Is it possible to filter the panels created in a dashboard using GRAFANA based on their name

I have created a dashboard in grafana having multiple status panels. I need to provide a dropdown such that when one option is selected all the panels having a name corresponding to the selected option will be filtered. So, basically i need to filter the panels based on their name.Is this possible. If yes, how can we go about it
a bit late for an answer now I suppose but will answer you anyway. You can create filters in Grafana without the need for a plug in through using the Variables feature in your Dashboard settings. Its also used in templating to make your data more dynamic but also crucial in display when you want to filter. Check out the link below
https://grafana.com/docs/grafana/latest/reference/templating/
The way to accomplish something like this is with Grafana's Repeating Rows/Panels feature.
Essentially, this lets you dynamically duplicate a row/panel for all the possible results of a given variable. Then a dashboard user can use the variable selection UI to drill down and only show certain rows or panels. Make sure you allow multi-select and/or All as an option for the variable(s) so that you can see multiple results at a time.

Add a Filter for Date Range option in a list

Here is a little background on the task:
My client has a sharepoint site that has a list of data. One of the columns or fields is a date field, this date is entered manually using MM/DD/YY Format.
My client has requested me to add an option where they could filter the columns by a range of dates on the webpart view.
I read this guide: https://www.nothingbutsharepoint.com/sites/eusp/pages/sharepoint-list-filtering-by-date-range.aspx and i got it to work, but it seems to be a bit buggy, meaning that sometimes the list will not get filtered by the specified dates..
Another issue with this method is that there is no Submit/Go button.
FROM: [ Text Field ] TO: [ Text Field ] [GO Button]
My client would love to have something like the example above where there are two text fields next to each other and a button that they can click to make the filter activate.
I searched for hours and hours and was not able to find something like this.
Do you guys know of a solution and if so, provide me with a link or guide, on how to achieve this problem? Thanks
EDIT:
It seems that there is a Apply Filters Button Web Part that does what i need. I added it and it seems to work Okay. I have to click Apply Filters TWICE in order for it to work.. weird huh? is there a fix for that?
FYI: i followed the guide linked above and just added the apply filters button.
Okay i fixed it,
It was because i was adding the date filter web parts to the library itself, and i was supposed to create a page for it and add my web-parts in there.
Found a solution that'll load the filters on first click for me.
In SPD, under the web part that displays the list items (XsltListViewWebPart), change these two to "True":
ClientRender="True" and IsClientRender="True"
Similar issues mentioned in this thread gave insights to button load sequences and why it doesn't render results on the first click.

Repeatable data content in umbraco

I am just wondering is there any plugin to create dynamic content for a page i.e something similar to a data repeaters in .net. To make it simple it should be a section that should contains 5 to 6 fields/property like
heading
heading 2
image
content - rich text editor
info
This must be in repeatable control so that the editor can add any number of these section a page and all these should be displayed in a single page.
Is there a plugin for the above functionality or what is the best way to achieve this.Any help would be greatly appreciated.
Thanks
Aneesh
You can achieve this without any plugins.
Create your repeatable section (containing the relevant fields) as a document type, and then use the multi-node picker in another document type to select one or many of the sections.
So for example, I could have a FAQs page (which uses a document type called "FAQs Page"), and I want to be able to add multiple question and answers to this page. I could set up a document type called "Question". This will contain two fields: Question and Answer.
On the "FAQs Page" document type, I would add a multi-node picker field called "Questions". This way, an author could select multiple "Question" nodes to appear on the FAQs page.
You would obviously need the code to output this, and also you would create a data type that inherited from multi-node picker, so that you could limit the selection to only Question nodes.
There is also the Repeatable Custom Content datatype which works well but does not support all data types. But it does support all the ones you need for your stated purpose (textstring, media picker, richtext area, etc).
You can find it here: http://our.umbraco.org/projects/backoffice-extensions/repeatable-custom-content I've used it a few times and it works really well in certain situations (e.g. where the items will not be shared across different pages of your site).
If you are sharing content components across multiple pages then #Digbyswift's solution is perfect.
I've always Digbyswifts method, but whilst looking for an alternate solution tonight I found this plugin, which is excellent for those situations where creating lots of widget nodes feels like overkill. It's licensed but the free older version is also available.
http://inaboxdesign.dk/blog/widget-builder-for-umbraco/

How to track checkboxes with Django and endless pagination?

I am a Django noob and have a situation that goes beyond the basic documentation, etc.
I am updating an ordering webpage that has a form structured as follows:
several text boxes, etc to gather general info (name, date, etc)
two separate tables for selecting (via checkbox) catalogs that are generated/managed using endless_pagination. Each table can have thousands of records, hence the endless_pagination. The first column in each table is a checkbox with value = catalog.id.
a textbox where the user can manually enter catalog IDs
a submit button
I am not sure how to keep track of what a user has selected in the two paginated tables since the checked boxes are lost when choosing a different page. Also, when the user flips back and forth between the pages, the previoulsy checked catalogs will need to be re-checked(since the checked state is not maintained). I am also not sure which tool(s) to use to deal with this.
My thought is to use JavaScript (with which I have minimal experience) to update a list of catalog IDs whenever a checkbox is checked/unchecked and:
- and attach that list to the form or
- update a variable in the form or
- send as a variable separate from the form, whichever is possible/makes more sense.
I'm hoping that maintaining a list of catalog IDs is possible because the next iteration of this form will likely include some sort of filtering so I'm trying to devise a solution that will not have to be reworked later.
I have reviewed a lot of posts but I believe the closest solutions are rendered useless because of the endless_pagination.
Let me know if further clarification is required. Thanks in advance for any suggestions.
UPDATE
I tried using JavaScript to store the catalog IDs in an array when a checkbox is checked. This does not work when a user selects another page in the pagination. The array of checked catalog IDs is lost when the page 'reloads'.
I'm running into this problem right now as well. I'm handling this by writing the checked items to localStorage so they carry across to page 2, 3, etc.. as well as show up as already checked when you go back to page 1. Then every time the page loads, either find and check the existing checkbox, or create a hidden input with the appropriate name and value and append it to the main form.
var selected_items = []
function add_item_to_checkbox(item) {
localStorage.setItem('selected_items', JSON.stringify(selected_items));
checkbox.on("click", add_item_to_checkbox);
bahh... Just look at my jsfiddle it's easier to read and yeah. I don't have to type JS into a textarea on stackoverflow.
Here is my javascript minus a few things that are specific to my code. I'm sure it could be improved upon but it works really well for my application.