Solved

How to split a string in a column and have it show up in the search drop down box at the footer search box.

Posted on 2014-04-23
1
212 Views
Last Modified: 2014-05-13
take this example here: http://www.datatables.net/examples/api/multi_filter_select.html, now suppose i want to keep Win 98+ / OSX.2+ show up in the platform column but underneath in the drop down box I want it to show Win 98+  in one row and OSX.2+ in the other.
0
Comment
Question by:cbrune
1 Comment
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40018604
I wouldn't do a 2nd row.  But you can add on to the select in the function fnCreateSelect.  I have a working example here http://jsbin.com/woyem/1/edit. You can either hard code it or generate via your serverside code.  You can also adjust how the data is pulled for the drop down and just use the first 3 letters.

	
			function fnCreateSelect( aData )
			{
				var r='<select><option value=""></option>', i, iLen=aData.length;
				for ( i=0 ; i<iLen ; i++ )
				{
					r += '<option value="'+aData[i]+'">'+aData[i]+'</option>';
				}
// ADD VIA SERVER SIDE CODE or HARD CODE
              r += '<option value="Win">Win</option>'
              r += '<option value="OSX">OSX</option>'
				return r+'</select>';
			}
			

Open in new window

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now