| 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 |
I want to integrate jQuery autoSuggest box with the HtmlFilterEditor.
Jun 3, 2010
Project Member
#1
jeff.johnston.mn@gmail.com
Jun 7, 2010
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
What errors are you getting? Do you use Firebug? That is a great tool for debugging these kinds of issues.
Jun 9, 2010
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
Not sure if this is still an issue or not...closing for now.
Status:
Invalid
|