Multiple Inputs/Checkboxes jQuery Search - javascript

I'm not sure where the best place to start or the best way to achieve this is but I currently have 4 multiple sliders (two handles within on slider), one input box, another 4 checkboxes and a dropdown and have 1000+ results being returned, I want to whenever something is changed, to update the results via jQuery and paginate it.
So far, I have the results return in multiple formats, json, html, but am not sure the best way to achieve this live (onchange of anything) search with pagination.
Any suggestions or if you can point me in the right direction would be very much appreciated.

Not sure where you want to display these 1000+ results.. I hope not in a dropdown as that would seriously upset most users. :D
Have a look at jquery datatables.

Related

Populating <select></select> with a large number of values

I have a web form which has the user input the values of certain characteristics, however some of the characteristics have up to 45000 values.
The selects were working earlier, albeit with a slight amount of lag when populating the dropdown and trying to scroll through it fast, but now it does not populate at all and the web form hangs.
Is there a way to efficiently contain this many values into a dropdown? Also which is the best library for searchable comboboxes?
I looked at this implementation as it has a "load on open" feature which I thought might be beneficial, but it did not seem to work and is no longer actively developed.
http://john-oc.github.io/
Thanks
Perhaps it would be better to use an autocomplete feature instead of a select menu in this case. A user can type in the first few characters, causing a request to start filtering results based on their input.
Here are a couple of really good autocomplete plugins:
https://github.com/devbridge/jQuery-Autocomplete
Roll your own:
http://www.webreference.com/programming/javascript/rg16/index.html
I agree with Todd, I think you might want some solution that has autocomplete to hide too many results. I'd even go a step further and suggest bootstrap DataTables: https://datatables.net/manual/styling/bootstrap
You can make searchable tables with this, with the key advantage being that it paginates results, so you don't see it all at once.
I'm a big fan of https://github.com/angular-ui/ui-select. You can have it make a request based on the current text input, and then populate the dropdown.
Since the question is already answered, please let me just contribute here.
You can use the typeaheads from angularStrap to achieve this. Beyond the easy manipulation of data, you can even use to make async calls using data provider.

reshuffling table columns with D3 or Angular

Hi fellow Javascripters,
I am using both Angular and D3 in my project (no jQuery, which I intend to keep this way). One thing that I want to support is to enable users to play with 'raw' tabular data. So, data from a CSV is loaded into my app and displayed in a plain old fashioned table (currently with Angulars ng-repeat). However, I now want to be able to animate that columns of the table get reshuffled. So, as a simple example, I would programmatically want to switch column 2 with column 4 and this transition must be D3-like. Furthermore, easily dragging whole columns to other positions should be possible.
Since I am not really experienced with working with jqLite inside Angular directives, my preference would go out to a solution based on D3. I can then see two possible solutions:
Render all of the data in a regular table using the D3 append functionality. Whenever column order changes, somehow reconstruct the table and create a smooth transition.
Simulate a table with div's and css (not looking forward to that though), to enable easy repositioning of data.
Since both solutions are far from trivial (I would say), I would really like to have some opinions. Do you see any other solutions for me? And if one of these two solutions seems right for you, how would you go about implementing them?
Thanks in advance!

jQuery content slider with customisable grid of elements

Does anyone know of a jQuery content slider (not just an image slider) that allows you to specify a grid of elements?
As an example, this is the sort of grid that I'm after:
http://cl.ly/image/0O213C1n2b0s
You can see that it's a 2x2 grid. With the controls, when someone clicks on a 'next' link, it should scroll to show the next 4 elements. I'd like to be able to have multiple instances on a page, each having different grids (I may be 3x2, 2x2, 4x1 on the same page)
Also, as an added caveat, I need this to be responsive.
First question is; does anyone know of a solution that already exists which would fit my requirements? If not, that leads to my second question; would anyone like to help me write such a thing? I'm relatively savvy with javascript (more specifically jQuery if I'm being absolutely honest) but by no means an expert.
I've done a fair amount of googling, but came up short. Hopefully someone is way ahead of me and has already written something along these lines.
What say you, Internet?
Have you seen this:
jQuery grid syle slider

jqGrid: Sortable columns set programmatically

I am looking for a way to sort columns programmatically.
Please bare in mind, I do not mean to sort the grid as you normally would with sortGrid() or whatnot. I mean to arrange the row order from left to right programmatically, after the grid has been rendered.
So, I am aware that with:
$("#myGrid").jqGrid({sortable: true});
I am able to sort the columns by dragging and dropping them in order. The idea is to allow users to sort their column, and to have a callback save the order in the database, so each user can arrange their own columns however they want.
I am doing something similar with showing and hiding columns, but have been unable to reorder the columns programmatically without actually dragging and dropping them.
Any help would be highly appreciated.
You can use remapColumns method to reorder the column programmatically without usage drag & drop.
In the answer you will find the code which shows how to save user specific choice of the column order in localStorage. I personally prefer the way as the saving of the same information on the server side in the database. Nevertheless you can implement saving of the same information in the database instead of localStorage. To do this you need just change the implementation of saveObjectInLocalStorage and getObjectFromLocalStorage functions and include the ajax call instead of usage window.localStorage.

How can I populate select boxes with multiple values?

I'm setting up a jqGrid which needs to visualize multiple values in one cell. The input comes from a form where the user can select multiple choices. I am able to display the select box, but not populate it. I have tried to insert an array in the JSON object, but to no success.
This is the model:
index:'ship', editoptions:{multiple:true, value:{1:”FedEx”,2:”InTime”,3:”TNT”,4:”ARAMEX”}}
And here are some variations of the data I've tried populating with:
ship:{[1],[4]}
ship:[[1],[4]]
ship:{value:{1,4}}
...and lots of other variations.
I've also searched the jqGrid forum, but didn't find a solution. How can I fix this problem?
Oh boy!
I had the answer all the time. It was just as easy as I had hoped it would be.
Here's how it's done:
ship:["FedEx","TNT"]
The reason for why I didn't think it worked is because jqGrid shows the data as "FedEx, TNT", thus making me believe it was only a string. Instead of clicking the cell to see what had happend, I spent hours looking for the answer on the internet. If you'd like to know what happends; jqGrid renders a select list with both elements selected. Simple.
Happy jqGrid'ing!

Categories

Resources