Note that there are some explanatory texts on larger screens.

plurals
  1. POjqgrid search popup allows all filters to be removed!
    primarykey
    data
    text
    <p>I'm trying out very simple search popup on the JqGrid. Please see the code below. There are few issues:</p> <ul> <li><p>The popup comes up with AND/OR and [+] controls at the very top. See screenshot below: (from FF 4)<img src="https://i.stack.imgur.com/ydwmc.png" alt="enter image description here"></p></li> <li><p>You can click on [-] button to remove the very first (and only) filter row. It shouldn't be allowed. First filter row should never be allowed to be removed.</p></li> <li><p>Code:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;JQGRID Test&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" media="screen" href="http://trirand.com/blog/jqgrid/themes/redmond/jquery-ui-1.8.1.custom.css"/&gt; &lt;link rel="stylesheet" type="text/css" media="screen" href="http://trirand.com/blog/jqgrid/themes/ui.jqgrid.css"/&gt; &lt;script type="text/javascript" src="http://trirand.com/blog/jqgrid/js/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://trirand.com/blog/jqgrid/js/jquery-ui-1.8.1.custom.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://trirand.com/blog/jqgrid/js/i18n/grid.locale-en.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://trirand.com/blog/jqgrid/js/jquery.jqGrid.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { createGrid(); }); function createGrid() { $("#jqgrid-table").jqGrid({ colNames:['First Name', 'Last Name', 'Age', 'IQ', 'Type'], colModel:[ {name:'firstName',index:'firstName', width:100}, {name:'lastName',index:'lastName', width:100}, {name:'age', index:'age', width:50}, {name:'iq', index:'iq', width:50, stype:'select', searchoptions: {dataUrl:'/api/domains/putcalldomain'}}, {name:'type', index:'type', width: 56} ], width: 800, datatype:'local', pager: '#pager2', viewrecords: true, caption:"JSON Example" }); var searchOptions = { caption: 'Filter...', multipleSearch:true, closeAfterSearch:true, closeAfterReset:true, Find: 'Filter' }; jQuery("#jqgrid-table").jqGrid('navGrid', '#pager2', {search:true, edit:false, add:false, del:false, refresh:false}, null, null, null, searchOptions ); var data = getData(); for(var i =0; i &lt; data.length; i++) { var r = data[i]; jQuery("#jqgrid-table").addRowData(r.id, r); } } function getData() { return [ {id:1, firstName: 'John', lastName: 'XXX', age:'30', iq:'200', type: 'Nice'}, {id:2, firstName: 'Ashley', lastName:'YYY', age:'31', iq:'210', type:'Nicer'}, {id:3, firstName:'Smith', lastName:'ZZZ', age:'23', iq:'90', type:'Nicest'} ]; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id='jqgrid-div'&gt; &lt;table id='jqgrid-table'&gt;&lt;/table&gt; &lt;div id="pager2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload