You posted two separate questions together. It makes difficult for other users to find the information. It's better to separate the current questions in two.
Nevertheless, about the first part of your question I want just describe that the behavior of the old Searching Dialog was so because of the usage of jQuery.clone. The function had many bugs which was not fixed since a long time. So the Searching Dialog worked wrong in some situations. In the new implementation of the Searching Dialog one didn't used jQuery.clone explicitly as the only safe way to solve the problems. The behavior which you miss in the new version of the Searching Dialog was by default implemented. In the new Searching Dialog the corresponding code isn't exist, but you can write it yourself. Mostly what you need is to write your custom code in the afterRedraw callback.
You should take in consideration that jqGrid support now powerful multipleGroup: true
option. So what you need is probably to copy the selections from another controls of the same group:
About your second question:
The answer contains the demo which describe the idea to unbind the click
. Probably event better would be to unbind or to hide the "Delete rule" button only if it is the only button.
If you don't use multipleGroup: true
option you can try the following
$.extend($.jgrid.search, {
multipleSearch: true,
overlay: 0,
afterRedraw: function () {
// don't permit to remove the last rule
$('input.delete-rule:first',this).unbind('click').hide();
}
});
In case of usage multipleGroup: true
the better will be probably another code
$.extend($.jgrid.search, {
multipleSearch: true,
multipleGroup: true,
overlay: 0,
afterRedraw: function () {
// don't permit to remove the last rule
var $delRules = $('input.delete-rule', this);
if ($delRules.length === 1) {
$delRules.unbind('click').hide();
}
}
});