Hi JS-ers,
I’m new to web development, JQuery, jqGrid. Kindly bear with me. I’ve a grid displaying data from database. Data looks fine. But when I try to enable search button, it doesn’t work.
My header looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<!-- <script type="text/javascript" src="http://localhost/learn_routing/public/js/jquery.js"> </script> --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script><script src="http://localhost/learn_routing/public/js/grid.locale-en.js" type="text/javascript">// <![CDATA[ // ]]></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js" type="text/javascript"></script><script src="http://localhost/learn_routing/public/js/jquery.jqGrid.min.js" type="text/javascript">// <![CDATA[ // ]]></script> <script src="http://localhost/learn_routing/public/js/grid.common.js" type="text/javascript">// <![CDATA[ // ]]></script> <script src="http://localhost/learn_routing/public/js/grid.filter.js" type="text/javascript">// <![CDATA[ // ]]></script> <script src="http://localhost/learn_routing/public/js/grid.formedit.js" type="text/javascript">// <![CDATA[ // ]]></script> <script src="http://localhost/learn_routing/views/test/js/test.js" type="text/javascript">// <![CDATA[ // ]]></script> |
My JS code looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
$("#grid_illume").jqGrid({ url:'test/xhr_get_data', datatype: "json", mtype: "GET", jsonReader: { repeatitems: false, id: "", root: function (obj) { return obj; }, records: function (obj) { return obj.length; }, page: function () { return 1; }, total: function () { return 1; } }, datatype: 'json', width: 'auto', colNames:['study','Sample Name','Forward Primer','Reverse Primer'], colModel :[ {name:"study",sortable: true}, {name: "sample_name",sortable: true}, {name: "forward_primer",sortable: true}, {name: "reverse_primer",sortable: true} ], rowNum:10, //this sets the default row in the pager pager: '#pager_illume', shrinkToFit : false, rownumbers: true, //row numbers on left multiselect: true, //check box height: '100%', //height: 'auto', gridview: true, viewrecord:true, // don't know sortorder:"asc", //asc autoencode: true, //don't know sortable:true, //sort loadonce: true, //loadonce is must rowList:[10,20,30], //drop down caption:"jqGrid Illume Example" //title of the grid }); |
For Search:
1 2 3 4 5 6 7 8 9 10 11 12 |
jQuery("#grid_illume").jqGrid('navGrid','#pager_illume', {edit:false,add:false,del:false,refresh:false,search: true}, {}, {}, {}, { multipleGroup: true, closeOnEscape: true, caption: "Search...", multipleSearch: true, Find: "Find" } ); |
I can see a search button in the left bottom of the grid, however on click I do not get a modal to search. How do I enable, or fix it?
Thanks.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top