Reputation: 115
I'm trying to figure out how to use search function in jqgrid 4.6, basically I'm doing the same thing as here: http://www.codeproject.com/Articles/58357/Using-jqGrid-s-search-toolbar-with-multiple-filter
But in the search panel nothing is showing in the condition, there should be 'equal' or 'contain' which I can select :
Here is my code, did I miss anything?
function showGrid() {
$('#ListMessagesGrid').jqGrid({
caption: paramFromView.Caption,
colNames: ['EB_USER_MESSAGE_ID', paramFromView.MESSAGE_INFO_IDENTIFIER, paramFromView.MESSAGE_INFO_TIMESTAMP,
paramFromView.MESSAGE_PARTY_FROM, paramFromView.MESSAGE_PARTY_TO, paramFromView.MESSAGE_COLLAB_SERVICE,
paramFromView.MESSAGE_COLLAB_ACTION, paramFromView.MESSAGE_COLLAB_AGREEMENTREF, paramFromView.MESSAGE_COLLAB_CONVERSATION_ID],
colModel: [
{ name: 'EB_USER_MESSAGE_ID', index: 'EB_USER_MESSAGE_ID', width: 80, hidden: false, key: true, search: false },
{ name: 'MESSAGE_INFO_IDENTIFIER', index: 'MESSAGE_INFO_IDENTIFIER', width: 600, searchoptions: { sopt: ['eq', 'cn'] } },
{ name: 'MESSAGE_INFO_TIMESTAMP', index: 'MESSAGE_INFO_TIMESTAMP', width: 450 },
{ name: 'MESSAGE_PARTY_FROM', index: 'MESSAGE_PARTY_FROM', width: 200 },
{ name: 'MESSAGE_PARTY_TO', index: 'MESSAGE_PARTY_TO', width: 200 },
{ name: 'MESSAGE_COLLAB_SERVICE', index: 'MESSAGE_COLLAB_SERVICE', width: 450 },
{ name: 'MESSAGE_COLLAB_ACTION', index: 'MESSAGE_COLLAB_ACTION', width: 300 },
{ name: 'MESSAGE_COLLAB_AGREEMENTREF', index: 'MESSAGE_COLLAB_AGREEMENTREF', width: 350 },
{ name: 'MESSAGE_COLLAB_CONVERSATION_ID', index: 'MESSAGE_COLLAB_CONVERSATION_ID', width: 650 }
],
hidegrid: false,
multiselect: true,
pager: jQuery('#ListMessagesPager'),
sortname: 'EB_USER_MESSAGE_ID',
rowNum: paramFromView.PageSize,
rowList: [10, 20, 50, 100],
sortorder: "desc",
width: paramFromView.Width,
height: paramFromView.Height,
datatype: 'json',
caption: paramFromView.Caption,
viewrecords: true,
autoencode : true,
mtype: 'GET',
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
userdata: "userdata"
},
url: paramFromView.Url
}).navGrid('#ListMessagesPager', { view: false, del: false, add: false, edit: false },
{ width: 400 }, // 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*/
).navButtonAdd('#ListMessagesPager', {
caption: paramFromView.DeleteAllCaption, buttonimg: "", onClickButton: function () {
if (confirm(paramFromView.DeleteAllConfirmationMessage)) {
document.location = paramFromView.ClearGridUrl;
}
else {
$('#ListMessagesGrid').resetSelection();
}
}, position: "last"
});
};
Update
I found something :
For some reason all values in aoprs array are undefined, so the drop down list not getting populated, is there anyway to fix this?
Upvotes: 0
Views: 453
Reputation: 221997
Do you sure that you included i18n/grid.locale-en.js
before jquery.jqGrid.min.js
in the application which have the problem? It's the typical error in the case.
I recommend yot to try to use more recent version of jqGrid. I develop for example free jqGrid. It's the fork of jqGrid based on jqGrid 4.7: the latest version available under MIT and GPLv2 licenses. Free jqGrid are provided also under MIT and GPLv2 licenses. The main file jquery.jqGrid.min.js
(or jquery.jqGrid.src.js
) already includes English locale i18n/grid.locale-en.js
. So one need to include locale file only in case of usage other language. Free jqGrid contains a lot of additional enhancements which I described in wiki and readmes to every version. If you want to use free jqGrid in internet application that I recommend you to use URLs from CDN. See the wiki article for details.
Upvotes: 1