Guriddo » All Posts https://guriddo.net/?forum=guriddo-js%2Fdiscussion&feed=rss2 Thu, 30 Oct 2025 02:26:02 +0000 https://bbpress.org/?v=2.6.14 en-US https://guriddo.net/?topic=filter-toolbar-not-passing-the-search-parameters-to-mvc-controller#post-127519 <![CDATA[Reply To: Filter Toolbar not passing the search parameters to MVC controller]]> https://guriddo.net/?topic=filter-toolbar-not-passing-the-search-parameters-to-mvc-controller#post-127519 Fri, 27 Nov 2020 09:13:42 +0000 guriddo.support Hello,

 

The searchField, searchOper, and searchString field values are not present in filterToolbar method. These are valid only in certain cases in form searching (this is a old behaviour)

 

Instead of this use the filters property and accept it in the server. I recommend you to read this docs Here we describe what is posted to the server when searching

Kind Regards

Will

Guriddo Support Team

]]>
https://guriddo.net/?topic=filter-toolbar-not-passing-the-search-parameters-to-mvc-controller#post-127518 <![CDATA[Filter Toolbar not passing the search parameters to MVC controller]]> https://guriddo.net/?topic=filter-toolbar-not-passing-the-search-parameters-to-mvc-controller#post-127518 Thu, 26 Nov 2020 14:06:06 +0000 Whiterainbow Hi,

Here goes my grid code:

function LoadGrid() {
$(function () {
$(“#mailGrid”).jqGrid({
url: “/Home/GetAllTaggedMails”,
datatype: ‘json’,
cache: true,
styleUI: ‘Bootstrap’,
ajaxGridOptions: { contentType: “application/json” },
mtype: ‘Get’,
colNames: [‘ID’, ‘HasAttachments’, ‘ItemId’, ”, ‘Subject’, ‘Date/Time Sent’, ‘Recipients’, ‘Group Name’, ‘Sent/Rec’],
colModel: [
{ key: true, name: ‘ID’, index: ‘ID’, editable: false, search: false, sortable: false, hidden: true },//, width: ‘5%’
{ key: false, name: ‘HasAttachments’, search: false, editable: false, sortable: false, hidden: true },//index: ‘HasAttachments’,
{ key: false, name: ‘ItemId’, index: ‘ItemId’, search: false, editable: false, sortable: false, hidden: true },
{ key: false, name: ‘RowID’, formatter: imgFormatter, valign: ‘top’, search: false, sortable: false, align: ‘center’, defaultvalue: “”, width: ‘2%’ },
{ key: false, name: ‘Subject’, index: ‘Subject’, formatter: urlFormatter, editable: false, search: true, sortable: false, width: ‘33%’, searchoptions: { sopt: [‘cn’, ‘eq’], ignoreCase: true } },
{ key: false, name: ‘SentDate’, index: ‘SentDate’, formatter: ‘date’, sorttype: ‘date’, width: ‘15%’, editable: false, search: false, sortable: false, formatoptions: { srcformat: ‘Y-m-d H:i:s’, newformat: ‘Y-m-d H:i:s’, defaultvalue: ” } },
{ key: false, name: ‘Recipient’, index: ‘Recipient’, search: true, searchoptions: { sopt: [‘cn’, ‘eq’], ignoreCase: true }, editable: false, width: ‘20%’, sortable: false },
{ key: false, name: ‘GroupName’, index: ‘GroupName’, search: true, searchoptions: { sopt: [‘cn’, ‘eq’], ignoreCase: true }, editable: false, sortable: false, width: ‘22%’, searchoptions: { sopt: [‘cn’, ‘eq’], ignoreCase: true } },
{ key: false, name: ‘Direction’, search: true,stype:’select’, editable: false, width: ‘8%’, sortable: false, defaultvalue: “Sent”, formatter: boundFormatter, valign: ‘middle’, align: ‘center’ }
],
sortorder: ‘desc’,
grouping: true,
groupingView: {
groupField: [‘GroupName’],
groupDataSorted: true,
//plusicon: ‘ui-icon-circle-plus’,
//minusicon: ‘ui-icon-circle-minus’
},
sortname: ‘SentDate’,
fluid: true,
//sortable: true,
rowNum: 50,
forceFit: true,
gridview: true,
page: 1,
headertitles: true,
//rowList: [25, 50, 75, 100],
height: ‘400px’,
width: ‘100%’,
scroll: 1,
scrollOffset: 0,
forceClientSorting: true,
viewrecords: true,
search: true,
shrinkToFit: true,
pager: jQuery(‘#mailGridControls’),
emptyrecords: ‘There is no tagged emails found for previous week.’,
jsonReader: {
root: “rows”,
page: “page”,
total: “total”,
records: “records”,
Id: ‘Id’,
repeatitems: false,
IsLastPage: “IsLastPage”
},
autowidth: true,
multiselect: false,
loadComplete: function () {
$(“.input-elm”).val(“”);
},
beforeSelectRow: function (rowid, e) {
var $link = $(‘a’, e.target);
if (e.target.tagName.toUpperCase() === “A” || e.target.tagName.toUpperCase() === “IMG” || $link.length > 0) {
// link exist in the item which is clicked
return false;
}
return true;
},
onPaging: function (pageButton) {
}
}).navGrid(‘#mailGridControls’, {
edit: false, add: false, del: false, search: false,
searchtext: “Search Mails”, refresh: false
}, {}, {}, {},
{/*
zIndex: 999,
caption: “Search Tagged Email”,
overlay: false,
multipleSearch: false,
Find: “Search”,
ignoreCase: true,
sopt: [‘cn’, ‘eq’],
defaultSearch: ‘cn’,
closeAfterSearch: true,
beforeShowSearch: function ($form) {
//$(“.searchFilter table td .input-elm”).attr(‘style’, ‘width:200px !important;’);
setModalWidth(‘.ui-jqdialog’);
return true;
},
afterRedraw: function ($form) {
//$(“.searchFilter table td .input-elm”).attr(‘style’, ‘width:250px !important;’);
setModalWidth(‘.ui-jqdialog’);
return true;
}*/
});
$(“#mailGrid”).jqGrid(‘filterToolbar’, { searchOnEnter: false, ignoreCase: true, defaultSearch: “cn” });//autosearch:true, stringResult: false,
//var myGrid = $(“#mailGrid”);
//myGrid[0].triggerToolbar();

$(“#mailGrid”).navButtonAdd(‘#mailGridControls’, {
position: “left”,
caption: “Expand/Collapse All”,
title: “Expand/Collapse All”,
cursor: “pointer”,
buttonicon: “ui-icon-triangle-2-n-s”,
onClickButton: function () {
$(“#mailGrid”).find(“.treeclick”).trigger(‘click’);
}
});

if ($.session.get(‘IsInitial_load’) === “true”)
$(‘#mailGrid’).navButtonAdd(‘#mailGridControls’,
{
buttonicon: “ui-icon-plus”,
title: “More”,
caption: “More”,
position: “right”,
onClickButton: moreClicked
});
});
imgFormatter = function (cellvalue, options, rowObject) {
if (rowObject[“HasAttachments”] === “TRUE”)
return ““;
else
return “”;
};
boundFormatter = function (cellvalue, options, rowObject) {
if (cellvalue !== null && cellvalue !== undefined && cellvalue !== ‘null’ && cellvalue !== ‘undefined’) {
if (cellvalue.toUpperCase() === “SENT”)
return “" + cellvalue +"“;
else
return “" + cellvalue + "“;
}
else
return “Sent“;
};
urlFormatter = function (cellvalue, options, rowObject) {
var sub = cellvalue;
var oId = rowObject[“ItemId”];
var uId = rowObject[“ID”];
var webaccesssiteURL = $(“#webaccessURL”).val().toString().replace(“[ItemID]”, oId.replace(‘+’, ‘%2B’));
var retString = “” + sub + ““;

return retString;
};

if ($.session.get(‘CurrentPage’) !== ‘undefined’ || $.session.get(‘CurrentPage’) !== undefined)
$(“#mailGrid”).trigger(“reloadGrid”, [{ page: $.session.get(‘CurrentPage’) }]);
}

And my search code in the controller:

public JsonResult GetAllTaggedMails(string sord, string sidx, int page, int rows, bool _search, string searchField, string searchOper, string searchString)
{
try
{
int pageIndex = Convert.ToInt32(page) – 1;
int pageSize = rows;

#region Get the e-mail details with client matter code from the mailbox of the user

var topMails = Session[“AllTaggedMails”] == null ? GetTopMails() : Session[“AllTaggedMails”] as List<MailEntity>;

//if (Session[“AllTaggedMails”] == null)
Session[“AllTaggedMails”] = topMails as List<MailEntity>;

var allTaggedMails = topMails.OrderByDescending(y => y.SentDate).Select(
c => new
{
c.RowID,
ID = c.UniqueID.ToString(),
c.Subject,
SentDate = Convert.ToDateTime(c.SentDate),
c.Recipient,
HasAttachments = c.HasAttachments == true ? “TRUE” : “FALSE”,
GroupCode = c.GroupCode == null ? “” : c.GroupCode,
GroupName = c.GroupName == null ? “” : c.GroupName,
c.ItemId,
c.Direction
});

#endregion

#region Search

if (_search)
{
switch (searchField == null ? searchField : searchField.ToUpper())
{
case “SUBJECT”:
if (searchOper == “eq”)
allTaggedMails = allTaggedMails.Where(s => s.Subject.Equals(searchString));
else
allTaggedMails = allTaggedMails.Where(s => s.Subject.ToLower().Contains(searchString.ToLower()));
break;
case “RECIPIENT”:
if (searchOper == “eq”)
allTaggedMails = allTaggedMails.Where(s => s.Recipient.Equals(searchString));
else
allTaggedMails = allTaggedMails.Where(s => s.Recipient.ToLower().Contains(searchString.ToLower()));
break;
case “GROUPCODE”:
if (searchOper == “eq”)
allTaggedMails = allTaggedMails.Where(s => s.GroupCode.Equals(searchString));
else
allTaggedMails = allTaggedMails.Where(s => s.GroupCode.ToLower().Contains(searchString.ToLower()));
break;
case “GroupNAME”:
if (searchOper == “eq”)
allTaggedMails = allTaggedMails.Where(s => s.GroupName.Equals(searchString));
else
allTaggedMails = allTaggedMails.Where(s => s.GroupName.ToLower().Contains(searchString.ToLower()));
break;
}
}

#endregion

int totalRecords = allTaggedMails.Count();
var totalPages = (int)Math.Ceiling((float)totalRecords / (float)rows);

#region Sort

string sortIndex = string.Empty;
if (sidx != null)
{
if (sidx.IndexOf(‘,’) >= 0)
{
sortIndex = sidx.Split(new char[] { ‘,’ }, StringSplitOptions.RemoveEmptyEntries)[1].ToString().Trim();
}
}
else
sortIndex = “SENTDATE”;

//switch (sidx == null ? sidx : sidx.ToUpper())
switch (sortIndex.ToUpper())
{
case “SENTDATE”:
if (sord.ToUpper() == “DESC”)
allTaggedMails = allTaggedMails.OrderByDescending(s => s.SentDate);
else
allTaggedMails = allTaggedMails.OrderBy(s => s.SentDate);

break;
case “SUBJECT”:
if (sord.ToUpper() == “DESC”)
allTaggedMails = allTaggedMails.OrderByDescending(s => s.Subject);
else
allTaggedMails = allTaggedMails.OrderBy(s => s.Subject);

break;
case “GroupCODE”:
if (sord.ToUpper() == “DESC”)
allTaggedMails = allTaggedMails.OrderByDescending(s => s.GroupCode);
else
allTaggedMails = allTaggedMails.OrderBy(s => s.GroupCode);

break;
case “GroupNAME”:
if (sord.ToUpper() == “DESC”)
allTaggedMails = allTaggedMails.OrderByDescending(s => s.GroupName);
else
allTaggedMails = allTaggedMails.OrderBy(s => s.GroupName);

break;
case “ROWID”:
if (sord.ToUpper() == “DESC”)
allTaggedMails = allTaggedMails.OrderByDescending(s => s.HasAttachments);
else
allTaggedMails = allTaggedMails.OrderBy(s => s.HasAttachments);

break;
case “RECIPIENT”:
if (sord.ToUpper() == “DESC”)
allTaggedMails = allTaggedMails.OrderByDescending(s => s.Recipient);
else
allTaggedMails = allTaggedMails.OrderBy(s => s.Recipient);

break;
case “DIRECTION”:
if (sord.ToUpper() == “DESC”)
allTaggedMails = allTaggedMails.OrderByDescending(s => s.Direction);
else
allTaggedMails = allTaggedMails.OrderBy(s => s.Direction);

break;
default:
allTaggedMails = allTaggedMails.OrderByDescending(s => s.SentDate);
break;
}

#endregion

allTaggedMails = allTaggedMails.Skip(pageIndex * pageSize).Take(pageSize);

if (Session[“IsLastPage”] != null)
isLastPage = Convert.ToBoolean(Session[“IsLastPage”].ToString().ToLower());

var jsonData = new
{
total = totalPages,
page,
records = totalRecords,
rows = allTaggedMails.ToList(),
IsLastPage = isLastPage
};
return Json(jsonData, JsonRequestBehavior.AllowGet);

}
catch (Exception ex)
{
ExReporter.Report(ex, MethodInfo.GetCurrentMethod().Name.ToString(), MethodInfo.GetCurrentMethod().DeclaringType.ToString(), Session[“User”].ToString());
return null;
}
}

When I type the text in the filter columns, the controller method receives, the searchField, searchOper, and searchString field values as null but the _search is passed as true.

Please let me know where in the code I am making the mistake?

Thanks in advance.

Senthil Kumar M.

]]>
https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126270 <![CDATA[Reply To: Using Chosen plugin with select elements in add/edit form]]> https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126270 Thu, 13 Jul 2017 02:23:26 +0000 igor83 Hello.

Thank you. At your suggestion, I used the plugin select2.

]]>
https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126269 <![CDATA[Reply To: Using Chosen plugin with select elements in add/edit form]]> https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126269 Tue, 11 Jul 2017 08:39:49 +0000 tony Hello,

 

Look t my answer here: http://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form/#post-126261

 

Kind Regards,

]]>
https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126264 <![CDATA[Reply To: Using Chosen plugin with select elements in add/edit form]]> https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126264 Tue, 11 Jul 2017 04:10:33 +0000 igor83

Hello,

Which search is used – dialog search or toolbar search?

Kind Regards

toolbar search

]]>
https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126261 <![CDATA[Reply To: Using Chosen plugin with select elements in add/edit form]]> https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126261 Mon, 10 Jul 2017 13:10:38 +0000 tony Hello,

 

Use setTimeout within the dataInit and it will work, but there is a problem wit position and visibility (z-index).

 

Some possible resolution is here

 

If possible use another plugin like maybe select2.

 

Kind Regards,

]]>
https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126260 <![CDATA[Reply To: Using Chosen plugin with select elements in add/edit form]]> https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126260 Mon, 10 Jul 2017 11:28:25 +0000 tony Hello,

 

Which search is used – dialog search or toolbar search?

 

Kind Regards

]]>
https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126256 <![CDATA[Reply To: Using Chosen plugin with select elements in add/edit form]]> https://guriddo.net/?topic=using-chosen-plugin-with-select-elements-in-addedit-form#post-126256 Mon, 10 Jul 2017 03:17:38 +0000 igor83 Hello.
Also there was a question on this plugin.
I do so

but the plugin does not work. The search string does not even appear. Tell me what I’m doing wrong?

]]>
https://guriddo.net/?topic=roadmap-update#post-126096 <![CDATA[Reply To: Roadmap update]]> https://guriddo.net/?topic=roadmap-update#post-126096 Wed, 10 May 2017 08:28:41 +0000 tony Hello,

We have updated our Roadmap.

Kind Regards,

]]>
https://guriddo.net/?topic=roadmap-update#post-125635 <![CDATA[Reply To: Roadmap update]]> https://guriddo.net/?topic=roadmap-update#post-125635 Thu, 03 Nov 2016 08:16:53 +0000 tony Hell Kris,

Thank you for remaind us about this.
I have updated the Roadmap for 2016.
The Roadmap for 2017 will be available after publishing the new release (expected 10 November, 2016)

Kind Regards,

]]>