Hi ,
I am facing a weird issue. I am using filterhandler() and filterRender() functions.
I am using one textbox for entering the text for filtering. All the functionalities are working fine in google chrome but while checking in IE the filter textbox is losing focus while clicking on the textbox twice.
Below are the code
function filterhandler(evt, ui) {
var $toolbar = $grid.find('.pq-toolbar-search'),
$value = $toolbar.find(".filterValue"),
value = $value.val(),
condition = "begin",
filterObject;
filterObject = [{ dataIndx: 'vslName', condition: condition, value: value}];
$("#grid_json").pqGrid("filter", {
oper: 'replace',
data: filterObject
});
}
function filterRender(ui) {
var val = ui.cellData,
filter = ui.column.filter;
if (filter && filter.on && filter.value) {
var condition = filter.condition,
valUpper = val.toUpperCase(),
txt = filter.value,
txt = (txt == null) ? "" : txt.toString(),
txtUpper = txt.toUpperCase(),
indx = -1;
if (condition == "begin") {
indx = valUpper.indexOf(txtUpper);
if (indx > 0) {
indx = -1;
}
}
if (indx >= 0) {
var txt1 = val.substring(0, indx);
var txt2 = val.substring(indx, indx + txt.length);
var txt3 = val.substring(indx + txt.length);
return txt1 + "<span style='background:yellow;color:#333;'>" + txt2 + "</span>" + txt3;
$("#grid_json").pqGrid("refreshDataAndView");
$('#grid').jqxGrid('ensurerowvisible', 2 );
}else {
return val;
}
}
else {
return val;
}
}
and object is:
var obj = {
height:320,
width:367,
numberCell:false,
editable: false,
resizable:true,
sortable:false,
columnBorders: false,
scrollModel:{autoFit:false, theme:false},
draggable:false,
collapsible: { on: false, collapsed: false },
showTitle: false,
showBottom:false,
dataModel: dataModel,
colModel: colModel,
numberCell: { show: false },
stripeRows : false,
track: true,
selectionModel: { type: 'none', subtype:'incr', cbHeader:true, cbAll:false},
filterModel: {type:'local', mode: 'OR' },
toolbar: {
cls: 'pq-toolbar-search',
items: [
{ type: "<span style='margin:3px; readonly='true''>Vessels</span>" },
{ type: 'textbox', cls: "filterValue", listeners: [{ 'keyup': filterhandler}] },
{type:'<button type="button" id="refresh" class="refresh refresh-primary">Clear</button> '},
{type:'<button type="button" id="ok" class="ok ok-primary" style="width:30px;">Ok</button>'},
/* {type:'<button type="button" id="cancel" class="cancel cancel-primary" style="width:50px;margin-left:5px;">Cancel</button>'},*/
],
},
editable: true,
scrollModel: { horizontal: false },
showTitle: false,
columnBorders: false
};
Please help me with this issue.
Thanks