jQuery UI Widgets › Forums › Grid › One of the columns in grid doesn't filter
This topic contains 2 replies, has 2 voices, and was last updated by gked 10 years, 10 months ago.
Viewing 3 posts - 1 through 3 (of 3 total)
-
Author
-
Hello guys,
I am having issue with one of the columns not being able to filter in my grid.
All columns filter successfully but the column called “FName”
Do you happen to know what the issue is?
here is the code:var SearchResult = new function () { var grid = "#searchGrid"; this.ExportToExcel = function () { $(grid).jqxGrid('showfilterrow', 'false'); $(grid).jqxGrid('exportdata', 'xls', 'jqxGrid'); $(grid).jqxGrid('showfilterrow', 'true'); } this.CleanSearch = function () { $(grid).jqxGrid('clear'); } this.displayGrid = function (filterExpression) { //var url = "searchresult/" + encodeURIComponent(filterExpression) + "/" + Division.DivisionCode; var url = "searchresult/" + Division.DivisionCode + "/(" + filterExpression.replace(/\%/g, '^').replace(/\//g, '|||') + ")"; Ajax.sendAjaxRequest("GET", url, null, function (data) { //source.localData = $.parseJSON(data); // prepare the data var source = { localData: $.parseJSON(data), dataType: "json", datafields: [ { name: 'DivisionCode', type: 'string' }, { name: 'ScheduledDate', type: 'date' }, { name: 'MRN', type: 'string' }, { name: 'FirstName', type: 'float' }, { name: 'LastName', type: 'string' }, { name: 'Category', type: 'string' }, { name: 'Procedure', type: 'string' }, { name: 'Service', type: 'float' }, { name: 'Status', type: 'string' }, { name: 'Ordered_By', type: 'string' }, { name: 'Fellow_Resident', type: 'float' }, { name: 'Technologist', type: 'string' }, { name: 'Nurse', type: 'string' }, { name: 'Attending', type: 'string' }, { name: 'Comments', type: 'float' }, { name: 'Indication', type: 'string' } ] }; initGrid(source); }); } function initGrid(source) { var dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function (records) { // get data records. var records = dataAdapter.records; }, loadError: function (jqXHR, status, error) { var e = error; }, beforeLoadComplete: function (records) { var r = records; } }); $(grid).jqxGrid( { theme: 'custom', source: dataAdapter, //pageable: true, width: 1000, //autoheight: true, sortable: true, showfilterrow: true, filterable: true, selectionmode: 'multiplecellsextended', columnsresize: true, //altrows: true, //enabletooltips: true, //editable: true, //selectionmode: 'multiplecellsadvanced', columns: [ { text: 'Date', datafield: 'ScheduledDate', filtertype: 'date', cellsalign: 'right', cellsformat: 'd', width: 50, resizable: false }, { text: 'MRN', datafield: 'MRN', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 50, resizable: false }, { text: 'FName', datafield: 'FirstName', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'LName', datafield: 'LastName', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'Category', datafield: 'Category', filtertype: 'checkedlist', width: 100, resizable: true }, { text: 'Procedure', datafield: 'Procedure', filtertype: 'checkedlist', width: 200, resizable: true }, { text: 'Service', datafield: 'Service', filtertype: 'checkedlist', width: 100, resizable: true }, { text: 'Status', datafield: 'Status', filtertype: 'checkedlist', width: 100, resizable: false }, { text: 'Ordered By', datafield: 'Ordered_By', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'Fellow_Resident', datafield: 'Fellow_Resident', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'Technologist', datafield: 'Technologist', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'Nurse', datafield: 'Nurse', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'Attending', datafield: 'Attending', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'Comments', datafield: 'Comments', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true }, { text: 'Indication', datafield: 'Indication', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', width: 100, resizable: true } ] }); } // Functions that can be called from the main page that contains this partial page. // initialize this.initialize = function () { //showGrid(); } }
Hello gked,
Are you sure the “FirstName” datafield’s type is supposed to be “float”? If not, you can try changing it to “string” and the filtering should work as expected.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Oh shoot…
how could I have missed that.
Thank you. -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.