My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 265: How to add a custom filter which integrates with a third party tool
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Mar 2011


 
Reported by raghaven...@gmail.com, Jun 2, 2010

I want to integrate jQuery autoSuggest box with the HtmlFilterEditor.

Jun 3, 2010
Project Member #1 jeff.johnston.mn@gmail.com
You should plug in your own FilterEditor. 

https://code.google.com/p/jmesa/wiki/FilterRecipes

Take a look at the HtmlFilterEditor as an example and be sure to ask questions if you
get stuck. What you want to do should be very possible.
Jun 7, 2010
#2 raghaven...@gmail.com
I have integrated jQuery autoSuggest box with the HtmlFilterEditor but that third party tool needs an ajax call to work but the filter is not allowing it to do the ajax call
Jun 8, 2010
Project Member #3 jeff.johnston.mn@gmail.com
What errors are you getting? Do you use Firebug? That is a great tool for debugging these kinds of issues.
Jun 9, 2010
#4 raghaven...@gmail.com
Yes I am using firebug. it is not giving any error. The problem is it is not sending request to serverside

createDynAutoSuggestFilter : function(filter, id, property) {
            if (dynFilter) {
                return;
            }

            dynAutoSuggestFilter = new classes.DynFilter(filter, id, property);
            
            var cell = $(filter);
            var width = cell.width();
            var originalValue = cell.text();
            var items; 
            
            if(((dynAutoSuggestFilter.property).indexOf("city") >= 0) && ((dynAutoSuggestFilter.property).indexOf("state") < 0)){
            	$.post('/BloodLnPickList.action?getCities',
        				function(data) {               
            				items = data;
        				});            	
            }
            
            if((dynAutoSuggestFilter.property).indexOf("city") >= 0 && (dynAutoSuggestFilter.property).indexOf("state") >= 0){
            	$.post('/BloodLnPickList.action?getStates',
        				function(data) {               
            				items = data;
        				});            	
            }          

            /* Enforce the width with a style. */
            cell.width(width);
            cell.parent().width(width);
            cell.css('overflow', 'visible');            
            cell.html('<div id="dynFilterAutoSuggestDiv"><input id="dynFilterAutoSuggestInput" class="autosuggest" name="filter" style="width:' + (width + 2) + 'px" value="" /></div>');
            
            var input = $('#dynFilterAutoSuggestInput');
            $('#dynFilterAutoSuggestInput').autocomplete(items, {
				minChars : 1,
				width : 100,					
				highlightItem : true,
				formatItem : function(oData, nIndex, nTotal) {						
					return oData.name;
				},
				formatResult : function(oData, nIndex, nTotal) {
					return oData.name;
				}
				}).result(function(oEvent,oData,oSelected)
				    {
						alert(oData.name);
					});            
            input.val(originalValue);           
            input.focus();

            $(input).keypress(function(event) {
                if (event.keyCode == 13) { /* Press the enter key. */
                    var changedValue = input.val();
                    cell.text('');
                    cell.css('overflow', 'hidden');
                    cell.text(changedValue);
                    $.jmesa.addFilterToLimit(dynAutoSuggestFilter.id, dynAutoSuggestFilter.property, changedValue);
                    $.jmesa.onInvokeAction(dynAutoSuggestFilter.id, 'filter');
                    dynAutoSuggestFilter = null;
                }
            });

            $(input).blur(function() {
                var changedValue = input.val();
                cell.text('');
                cell.css('overflow', 'hidden');
                cell.text(changedValue);
                $.jmesa.addFilterToLimit(dynAutoSuggestFilter.id, dynAutoSuggestFilter.property, changedValue);
                dynAutoSuggestFilter = null;
            });
        }

this is the code i have written in jquery.jmesa.js in filter section.
to retrieve items the ajax call is to be made which is not hapening in the filter
Mar 10, 2011
Project Member #5 jeff.johnston.mn@gmail.com
Not sure if this is still an issue or not...closing for now.
Status: Invalid

Powered by Google Project Hosting