Forum
17:22
31/08/2010
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":""}]}
17:44
31/08/2010
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',' ','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Ω)<br/>@V<sub>GS</sub>=1.2V',
'R<sub>DS(ON)</sub><br/>Max<br/>(mΩ)<br/>@V<sub>GS</sub>=1.5V',
'R<sub>DS(ON)</sub><br/>Max<br/>(mΩ)<br/>@V<sub>GS</sub>=1.8V',
'R<sub>DS(ON)</sub><br/>Max<br/>(mΩ)<br/>@V<sub>GS</sub>=2.5V',
'R<sub>DS(ON)</sub><br/>Max<br/>(mΩ)<br/>@V<sub>GS</sub>=4.0V',
'R<sub>DS(ON)</sub><br/>Max<br/>(mΩ)<br/>@V<sub>GS</sub>=4.5V',
'R<sub>DS(ON)</sub><br/>Max<br/>(mΩ)<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', 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');
}
});
});
21:39
24/08/2010
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/.
17:58
24/08/2010
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:
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.
12:33
31/08/2010
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.
I second your opinion that jqGrid should address this, but for now this helped our project a lot!
Thx a thousand times!
18:50
24/08/2010
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?
19:15
02/09/2010
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
*
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...
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
19:15
28/12/2010
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
jQuery(".ui-searchFilter td.ops select").filter(function () { return $(this).css("display") != "none"; }).attr("name", "op");
}
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66