Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

DOM search mangles international characters in IE8


Reply

2 Posts   827 Views

Avatar
MarcusDalgren

6 August 2010 at 12:54am Community Member, 288 Posts

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();
    });
}

Avatar
UncleCheese

6 August 2010 at 1:19am 4085 Posts

Great, thanks for that!