Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
In multiple search, second and subsequent ops are sent as undefined in IE6
31/08/2010
00:56
Avatar
Jiho Han
Member
Members
Forum Posts: 12
Member Since:
24/08/2010
sp_UserOfflineSmall Offline

Using 3.7.2, I am using multiple search and while on firefox the filter is sent correctly, on IE6, only the first op is sent correctly while the rest are sent as "undefined".

31/08/2010
17:22
Avatar
hstangor
Member
Members
Forum Posts: 4
Member Since:
31/08/2010
sp_UserOfflineSmall Offline

We have the same issue here, when specifying more than one search line we get op as undefined for IE 6.0, 7.0, 8.0 .

On Firefox and every other browser against the same backend everything works just fine.

An example filter that jqGrid sent to the server shows the problem:

filters = {"groupOp":"AND","rules":[{"field":"part","op":"eq","data":""},{"field":"part","op":"undefined","data":""}]}

31/08/2010
17:29
Avatar
hstangor
Member
Members
Forum Posts: 4
Member Since:
31/08/2010
sp_UserOfflineSmall Offline

Found a similar discussion inside the forum, tried the things mentioned inside there. Also to no avail.

/blog/?page_id=393/bugs/ie8-2nd-filter-opundefined/

31/08/2010
17:44
Avatar
hstangor
Member
Members
Forum Posts: 4
Member Since:
31/08/2010
sp_UserOfflineSmall Offline

Jquery 1.4.2 / JQuery UI 1.8.2 / JqGrid 3.7.1

Our Grid Setup:

function pdfFormatter (cellvalue, options, rowObject)
{
    return '<a target="_blank" href="http://www.our-domain.com/docs/transistor/'
           + cellvalue + '_en_datasheet.pdf"><img src="pdf.gif" border=0 /></a>';
}

jQuery(document).ready(function(){

    partfilter = $.url.param("partfilter");
    partfiltertext = "";
    if (partfilter != "") {
        partfiltertext = " (pre-filtered with Partnumber like %" + partfilter + "%)";
        partfilter = "&part=.*" + partfilter + ".*";
    }
    
    jQuery("#apsgrid").jqGrid({
    url: '/EDGEServices/ParametricSearch?cg=mosfets' + partfilter,
    mtype: 'GET',
    datatype: 'xml',
    xmlReader : {
        root: "products",
        row: "product",
        page: "products>page",
        total: "products>total",
        records : "products>records",
        repeatitems: false,
        id: "partnumber"
      },
    colNames:['PartNumber','&nbsp;','Category',
              'Polarity','Config','V<sub>DS</sub><br/>(V)','V<sub>GS</sub><br/>(V)',
              'I<sub>D</sub><br/>(A)','P<sub>D</sub><br/>(W)',
              'R<sub>DS(ON)</sub><br/>Max<br/>(m&Omega;)<br/>@V<sub>GS</sub>=1.2V',
              'R<sub>DS(ON)</sub><br/>Max<br/>(m&Omega;)<br/>@V<sub>GS</sub>=1.5V',
                'R<sub>DS(ON)</sub><br/>Max<br/>(m&Omega;)<br/>@V<sub>GS</sub>=1.8V',
                'R<sub>DS(ON)</sub><br/>Max<br/>(m&Omega;)<br/>@V<sub>GS</sub>=2.5V',
                'R<sub>DS(ON)</sub><br/>Max<br/>(m&Omega;)<br/>@V<sub>GS</sub>=4.0V',
                'R<sub>DS(ON)</sub><br/>Max<br/>(m&Omega;)<br/>@V<sub>GS</sub>=4.5V',
                'R<sub>DS(ON)</sub><br/>Max<br/>(m&Omega;)<br/>@V<sub>GS</sub>=10V',
                'Ciss<br/>(pF)','Qg<br/>(nC)','Pins',
              'Surface mount package','Package JEDEC','Package JEITA','Package T',
              'Comment','RoHS'],
    colModel :[
      {name:'PartNumber', index:'part', width:100, xmlmap:'partnumber', hidedlg:true,
       formatter:'showlink',
       formatoptions:{baseLinkUrl:'http://www.our-domain.com/transistors/MOSFET_Item.aspx&#39;, idName:'p'}
      },
      {name:'PDF', index:'pdf', width:30, xmlmap:'partnumber', hidedlg:true, align:'center', formatter:pdfFormatter, sortable:false},
      {name:'Category', index:'cat', width:80, xmlmap:'category', hidden:true, hidedlg:true},
      {name:'Polarity', index:'v01', width:80, xmlmap:'v01', align:'center'},
      {name:'Configuration', index:'v02', width:80, xmlmap:'v02', align:'center'},
      {name:'VDS', index:'v03', width:40, xmlmap:'v03', align:'center'},
      {name:'VGS', index:'v04', width:40, xmlmap:'v04', align:'center'},
      {name:'ID', index:'v05', width:40, xmlmap:'v05', align:'center'},
      {name:'PD', index:'v06', width:40, xmlmap:'v06', align:'center'},
      {name:'RDSon1.2V', index:'v07', width:70, xmlmap:'v07', align:'center'},
      {name:'RDSon1.5V', index:'v08', width:70, xmlmap:'v08', align:'center'},
      {name:'RDSon1.8V', index:'v09', width:70, xmlmap:'v09', align:'center'},
      {name:'RDSon2.5V', index:'v10', width:70, xmlmap:'v10', align:'center'},
      {name:'RDSon4.0V', index:'v11', width:70, xmlmap:'v11', align:'center'},
      {name:'RDSon4.5V', index:'v12', width:70, xmlmap:'v12', align:'center'},
      {name:'RDSon10.0V', index:'v13', width:70, xmlmap:'v13', align:'center'},
      {name:'Ciss', index:'v14', width:40, xmlmap:'v14', align:'center'},
      {name:'Qg', index:'v15', width:40, xmlmap:'v15', align:'center'},
      {name:'NumberOfPins', index:'v16', width:40, xmlmap:'v16', align:'center'},
      {name:'SurfaceMountPackage', index:'v17', width:80, xmlmap:'v17', align:'center'},
      {name:'PackageNameJEDEC', index:'v18', width:70, xmlmap:'v18', align:'center'},
      {name:'PackageNameJEITA', index:'v19', width:70, xmlmap:'v19', align:'center'},
      {name:'PackageNameT', index:'v20', width:130, xmlmap:'v20', align:'center'},
      {name:'Comment', index:'v21', width:110, xmlmap:'v21'},
      {name:'RoHSavailable', index:'v22', width:40, xmlmap:'v22', align:'center'}
    ],
    pager: '#apspager',
    rowNum:20,
    rowList:[10,20,40,50,100],
    sortname: 'part',
    sortorder: 'asc',
    caption: 'Parametric Search' + partfiltertext,
    viewrecords: true,
    gridview: true,
    loadonce: false,
    height:'auto',
    width:'auto'
  });
 
  jQuery("#apsgrid").jqGrid('navGrid','#apspager',{add:false,edit:false,del:false,search:true,refresh:true},{},{},{},{multipleSearch:true},{});

  jQuery("#apsgrid").jqGrid('navButtonAdd','#apspager',{
      caption: "Columns",
      title: "Reorder Columns",
      onClickButton : function (){
          jQuery("#apsgrid").jqGrid('columnChooser');
          // jQuery("#apsgrid").jqGrid('setColumns');
      }
  });

});

31/08/2010
21:39
Avatar
Jiho Han
Member
Members
Forum Posts: 12
Member Since:
24/08/2010
sp_UserOfflineSmall Offline

This seems to be related to a bug in jQuery 1.4.2 regarding clone().

I was browsing through the source and jqGrid clones an existing row when you click on the "+" button to add another criteria.

When the operators select element is created (in jquery.searchFilter.js), name attribute is added via jquery attr method.  The bug in jQuery is that when you clone, these dynamically set attributes are not cloned in IE <8.

                // IE copies events bound via attachEvent when
                // using cloneNode. Calling detachEvent on the
                // clone will also remove the events from the orignal
                // In order to get around this, we use innerHTML.
                // Unfortunately, this means some modifications to
                // attributes in IE that are actually only stored
                // as properties will not be copied (such as the
                // the name attribute on an input).

I see a proposed fix for this here: http://dev.jquery.com/ticket/6793.

There is also another workaround for it in the doc page comments for clone: http://api.jquery.com/clone/.

01/09/2010
17:58
Avatar
Jiho Han
Member
Members
Forum Posts: 12
Member Since:
24/08/2010
sp_UserOfflineSmall Offline

So while jQuery addresses this issue and waiting for jqGrid to address it as well, I thought I'd figure out a way to make this work for myself without having to touch their sources.

I mean one option I had was to modify the jqGrid source and use it but then I'd have to maintain it with or without minifying it myself, etc.  That didn't seem very attractive.

After searching for a while on google and StackOverflow, I came up with the following interim solution:

jQuery.event.special.click = {
    setup: function() {
        if (jQuery(this).hasClass("ui-search")) {
            jQuery(this).bind("click", jQuery.event.special.click.handler);
        }
        return false;
    },
    teardown: function() {
        jQuery(this).unbind("click", jQuery.event.special.click.handler);
        return false;
    },
    handler: function(event) {
        jQuery(".ui-searchFilter td.ops select").attr("name", "op");
    }
};

So basically what I'm doing is when the click is being attached the very first time on that search button, I bind my own handler.  The setup is called only once per event type per element, so this binding happens only once.  And since it happens before actually binding the very first handler, my own handler is now the very first handler.

And my own handler basically goes through all the operators select and assigns the name "op".

The effect is that every time that Find button is clicked, the operators select gets the name "op" before posting the data.

While this works, I wish that jqGrid would address this in a manner that is not dependent on the jQuery clone behavior for IE<8.

02/09/2010
12:33
Avatar
hstangor
Member
Members
Forum Posts: 4
Member Since:
31/08/2010
sp_UserOfflineSmall Offline

Jiho Han said:
After searching for a while on google and StackOverflow, I came up with the following interim solution: … While this works, I wish that jqGrid would address this in a manner that is not dependent on the jQuery clone behavior for IE<8.


Excellent workaround; i tried it here and it works like a charm. Very well done. Cool

I second your opinion that jqGrid should address this, but for now this helped our project a lot!

Thx a thousand times! Smile

02/09/2010
17:54
Avatar
respinoza
New Member
Members
Forum Posts: 2
Member Since:
02/09/2010
sp_UserOfflineSmall Offline

Hi, sorry… is a nice solution… but… there's still a problem when you press the reset button and the (-) button to delete a search row on the search box… both cases shows:

Line: 2605

Char: 10

Error. Type mismatch.

Code: 0

URL: <your url>

02/09/2010
18:50
Avatar
Jiho Han
Member
Members
Forum Posts: 12
Member Since:
24/08/2010
sp_UserOfflineSmall Offline

respinoza said:

Hi, sorry… is a nice solution… but… there's still a problem when you press the reset button and the (-) button to delete a search row on the search box… both cases shows:

Line: 2605

Char: 10

Error. Type mismatch.

Code: 0

URL: <your url>


That is strange - I am not getting this error you're getting.  Both reset and - buttons work just fine.

Are you using jqGrid 3.7.2 and jQuery 1.4.2?

02/09/2010
19:15
Avatar
respinoza
New Member
Members
Forum Posts: 2
Member Since:
02/09/2010
sp_UserOfflineSmall Offline

I have that versions... Here you have the data:

IE Version: 6.0.2900.5512 sp 3

Versions (from the javascript files)

/*

* jqGrid 3.7.2 - jQuery Grid

* Copyright (c) 2008, Tony Tomov, tony@trirand.com

...

/*!

* jQuery JavaScript Library v1.4.2

* http://jquery.com/

*

Code


<script type="text/javascript">

jQuery(document).ready(

jQuery(

url:

datatype:

mtype:

colNames: [

colModel: [

{ name:

{ name:

{ name:

pager: jQuery(

rowNum: 10,

rowList: [5, 10, 20, 50],

sortname:

sortorder:

viewrecords:

imgpath:

caption:

function() {"#list").jqGrid({'/Home/DynamicGridData2/','json','GET','Id', 'Votes', 'Title'],'Id', index: 'Id', width: 70, align: 'left' },'Votes', index: 'Votes', width: 70, align: 'left' },'Title', index: 'Title', width: 500, align: 'left'}],'#pager'),'Id',"desc",true,'/scripts/css/cupertino/images','My first grid'

}).navGrid(

{},

'#pager', { view: false, del: false, add: false, edit: false },// default settings for edit

{},

// default settings for add

{},

// delete instead that del:false we need this

{closeOnEscape:

true, multipleSearch: true, closeAfterSearch: true }, // search options

{}

/* view parameters*/

);

}

);

If you can edit vb .net code i can also send you the project in order to test it, just give me your mail address... i'm trying to assemble a model to work with jquery...

01/10/2010
17:12
Avatar
xmarcus
Member
Members
Forum Posts: 12
Member Since:
27/09/2010
sp_UserOfflineSmall Offline

This worked for me too..  thanks Jiho!

15/12/2010
21:25
Avatar
tonyrizk19
New Member
Members
Forum Posts: 1
Member Since:
15/12/2010
sp_UserOfflineSmall Offline

Jiho,

it didn't work for me...

can you please specify where exactly you put the code u suggested?

Thanks.

16/12/2010
21:26
Avatar
johan
USA
Member
Members
Forum Posts: 13
Member Since:
02/12/2010
sp_UserOfflineSmall Offline

Jiho, or anyone else. I am experiencing the same problem. Jiho's solution Ii thought worked for me but it seems that with it I can only ever get 'eq' .. instead of anything else I select. I also tried the fix posted on jquery site, but it has its own bugs too when cloning actions. So again with multiple search using jiho's solution, I can only ever search 'eq'.

Actually as I write this post I am finding that all columns are working besides my DateTime column which is using datepicker modified as DateTimePicker (includes time sliders). 

So I try to search a date range with a single date selected, using Greater or Equal, then the same date on the second selection using Less Than or Equal. Everything comes back as Equal only…

I am using IE8… If anyone could help I would appreciate it.

here is my code

{ name: 'CallDateTime', index: 'CallDateTime', width: 80, align: 'center', editable: false, resizable: true, searchoptions: { sopt: ['ge', 'le', 'gt', 'lt'], dataInit: function(el) { $(el).datetimepicker({ }); } } },
28/12/2010
19:15
Avatar
mkmeyer
New Member
Members
Forum Posts: 1
Member Since:
28/12/2010
sp_UserOfflineSmall Offline

johan,

We also had an issue with all always returning 'eq' after applying Jiho's fix when limiting the search options. We altered his handler's selector slightly, and have not yet found any issues. This appears to work for us.

We're using jQuery 1.4.4 / jqGrid 3.8.2

handler: function (event) {
     jQuery(".ui-searchFilter td.ops select").filter(function () { return $(this).css("display") != "none"; }).attr("name", "op");
}
29/12/2010
18:23
Avatar
johan
USA
Member
Members
Forum Posts: 13
Member Since:
02/12/2010
sp_UserOfflineSmall Offline

mkmeyer, Just wanted to say thank you for this. Verified all working for IE7 now. I hope to repay you at some point!

07/06/2011
16:47
Avatar
andesipe
New Member
Members
Forum Posts: 2
Member Since:
30/11/2010
sp_UserOfflineSmall Offline

Jiho,

worked for me too.

Thanks!!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
52 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information