jquery - Removing or Disabling the search tools bar (or filer row) from grid -
i'm using jqgrid in project , since i'm new datagrid i'm taking jqwidgets
here, i've used sorting, adding rows, deleting rows , filtering rows. code follow:
// initialize jqxgrid $("#jqxgrid").jqxgrid( { width: 900, source: dataadapter, theme: theme, editable: true, height: 300, pageable: true, sortable: true, showfilterrow: true, filterable: true, rendergridrows: function(obj) { return obj.data; }, columns: [ { text: 'employeeid', editable: false, datafield: 'employeeid', width: 100 }, { text: 'first name', datafield: 'firstname', width: 100 }, { text: 'last name', datafield: 'lastname', width: 100 }, { text: 'title', datafield: 'title', width: 180 }, { text: 'address', datafield: 'address', width: 180 }, { text: 'city', datafield: 'city', width: 100 }, { text: 'country', datafield: 'country', width: 140 } ] }); $("#jqxgrid").on("sort", function (event) { // $("#events").jqxpanel('clearcontent'); var sortinformation = event.args.sortinformation; var sortdirection = sortinformation.sortdirection.ascending ? "ascending" : "descending"; if (!sortinformation.sortdirection.ascending && !sortinformation.sortdirection.descending) { sortdirection = "null"; } var eventdata = "triggered 'sort' event <div>column:" + sortinformation.sortcolumn + ", direction: " + sortdirection + "</div>"; // $('#events').jqxpanel('prepend', '<div style="margin-top: 5px;">' + eventdata + '</div>'); }); $('#clearsortingbutton').jqxbutton({ height: 25, theme: theme }); $('#sortbackground').jqxcheckbox({checked: true, height: 25, theme: theme }); // clear sorting. $('#clearsortingbutton').click(function () { $("#jqxgrid").jqxgrid('removesort'); }); // show/hide sort background $('#sortbackground').on('change', function (event) { $("#jqxgrid").jqxgrid({ showsortcolumnbackground: event.args.checked }); }); $("#addrowbutton").jqxbutton({ theme: theme }); $("#deleterowbutton").jqxbutton({ theme: theme }); // create new row. $("#addrowbutton").click(function (){//alert("here"); var datarow = generaterow(); //alert(datarow['employeeid']); var commit = $("#jqxgrid").jqxgrid('addrow', null, datarow); }); // delete row. $("#deleterowbutton").click(function () { var selectedrowindex = $("#jqxgrid").jqxgrid('getselectedrowindex'); var rowscount = $("#jqxgrid").jqxgrid('getdatainformation').rowscount; if (selectedrowindex >= 0 && selectedrowindex < rowscount) {//alert('here'); var id = $("#jqxgrid").jqxgrid('getrowid', selectedrowindex); var commit = $("#jqxgrid").jqxgrid('deleterow', id); } });
from code, i'm getting filter row in columns. want remove filter column employeeid should remove search tool bar employeeid column?
the correct setting have set column "filterable: false"
Comments
Post a Comment