Only using certain parts of Autocomplete from Material UI - javascript

I'm trying to use Material-UI's component <Autocomplete/>
However, I want to remove certain functionality that isn't necessarily customizable according to the API. For example I want to remove the multiselect filter tags and shown below. Would it be possible just to take the logic of passing in a list and being able to search/autocomplete?

Related

React dates-Datepicker does not filter in ag-grid react

I was trying to implement a custom Date filter in ag grid using React. The link I followed is a link!
I was able to create the component (SingleDatePicker) and able to render it on the cell. But I had tried a lot to make it filter the data with the selected date. It does not happen to filter. I have used the methods according to the documentation like updateAndNotifyAgGrid etc. but still no luck.
I am using the agDateColumnFilter and my own custom component for rendering.
Could anyone please help me point out where I am doing wrong for this to not filter the data.

How to show multiple value in jQuery autocomplete?

I am trying to design a multi-column select/search box as the one shown below.
I thought about using jQuery-UI Autocomplete widget. I will make the list appear in focus so the user can select directly from the list or start typing in the search box to filter the data shown.
I know I can feed the Autocomplete an array of objects as the source and decide a label to be shown as the selected item when the user selects a row.
What I want is to show more than two columns on the list. Any idea how to accomplish that?
thanks,
Use autocomplete renderItem to customize your search results. For multiple column view, use html code in rendering to render table like view. And then use this library to render html in autocomplete UI.
I ended up using typeahead.js from twitter.
Paired with the bloodhound engine it gives the ability to specify costume templates for the list.

Formatting React selection dropdown options

Is there a way to format the options of a React input dropdown?
For example I would like to have an autocomplete dropdown that displays the options in a formatted fashion with columns. Almost like a dropdown data grid so that the user can see "Name", "Address", etc. in a uniform way.
React will render whatever you want into the DOM with the classes or styles that you choose. Solving the design problem wouldn't be any different then if you were just doing it with just html and css.
The React part of the equation is going to be handling interactions and making sure the right classes/styles end up on the right components. You can also always just opt into using a third party library built in react like http://jedwatson.github.io/react-select/

Select control search on the basis of data fields

Currently I am using Jquery Chosen Plugin in order to search the values written inside a search box and it works very well in case I want to search on the basis of the text written inside the option tag. i.e. as shown in the figure:
But what I want to achieve is search on the multiple basis i.e. on the basis of the text written inside the option tag as well as the data attributes of the option tag i.e.
For example in the above figure I may be able to search Debitors either by typing Debitors directly or by typing the data-phone's value i.e.0321-111111. I've searched the chosen plugin's documentation for the possibility to search on the basis of multiple values but, as much as I know, there wasn't any functionality provided by it.
Now what I'd like to ask is, Is there any jQuery plugin providing this multisearch functionality that you may know of?
Thanks.
Finally, I found Select2 Jquery plugin that allows the custom matcher for the searching. i.e. You can define whatever you want plugin's search to search.

Javascript combobox with typeahead and hierarchical items

I want to create a combobox with a hierarchical list of items. I need to be able to select the parent items as well as the children individually. I also need to be able to provide typeahead capabilities for this combobox.
For example, I want to make a combobox with this data in JS:
Canada
--Ontario
--Quebec
USA
--Massachusetts
--Ohio
--Texas
From this dropdown I want to be able to select any of the provinces/states individually. I also want to be able to select "Canada" without selecting it's children.
I've tried Select2 and have been digging around JQuery UI to see if it is possible, but so far I can't quite achieve the behaviour I need. I'm writing this page using bootstrap, but the given typeahead in boostrap doesn't seem to work with comboboxes at all (that I can see).
You can use Chosen javascript plugin to achieve this.
http://harvesthq.github.com/chosen/
You can store custom JS objects for each typeahead result so that it can displays and store more than just a string (a type, or ID for example). Using that would let you have different logic for country vs province/state. Here's an example of doing so:
https://github.com/twbs/bootstrap/pull/3682
So in the updater function, you could have logic based on your custom object to determine whether it's a parent or child that was clicked.
As far as making the parent look different than the child, I haven't used it myself, but there is a templating system in bootstrap. Check out this link for an example:
https://github.com/twbs/bootstrap/issues/2441
You could likely use this to differentiate the parent and child look and feel.

Categories