7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DOM search mangles international characters in IE8
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 667 Views |
-
DOM search mangles international characters in IE8

6 August 2010 at 12:54am
Took me awhile to solve this but I finally managed to fix this so that it works in all browsers. The problem is the way the URL is constructed in the js before it's sent. My changes turn the url variables into an object and send it through $.get instead of $.ajax and it now works in all browsers that I've tried.
Request building in the search function line 218
request = window.setTimeout(function() {
var url = $(container_id).attr('href').replace(/\[search\]=(.)*?&/, '[search]='+$input.val()+'&');
var getObj = {};
var getUrl = url.split("?");
var getVars = getUrl.pop().split("&");
var tempGet = [];
getUrl = getUrl.shift();for (i = 0; i < getVars.length; i++) {
tempGet = getVars.split("=");
getObj[tempGet[0]] = tempGet[1];
}
refresh($container, getUrl, getObj, '#srch_fld');
},500)Refresh function line 383
function refresh($div, link, getVars, focus)
{
// Kind of a hack. Pass the list of ids to the next refresh
var listValue = ($div.hasClass('RelationDataObjectManager')) ? jQuery('#'+$div.attr('id')+'_CheckedList').val() : false;
jQuery.get(link, getVars, function(html){
if(!$div.next().length && !$div.prev().length)
$div.parent().html(html);
else
$div.replaceWith(html);
if(listValue) {
jQuery('#'+$div.attr('id')+'_CheckedList').attr('value',listValue);
}
var $container = jQuery('#'+$div.attr('id'));
$container.DataObjectManager();
if (typeof focus == 'string') {
$container.find(focus).focus();
}
//jQuery('#'+$div.attr('id')).DataObjectManager();
});
} -
Re: DOM search mangles international characters in IE8

6 August 2010 at 1:19am
Great, thanks for that!
| 667 Views | ||
|
Page:
1
|
Go to Top |

