jQWidgets Forums
Forum Replies Created
-
Author
-
November 8, 2016 at 7:45 pm in reply to: New default values after migrating to 4.3.0 New default values after migrating to 4.3.0 #88849
Thank you, Peter for the response.
The two noted properties may lead to layout problems in some special situations (e.g. if we have tables with always constant numbers of rows and autoheight enabled and we designed other controls for this constant height floating left or right… – it will no more fit exactly…)I would appreciate to read such changes in the release notes in the future; you surely understand.
Are these two changes the only two?
Thanks.January 30, 2016 at 8:07 pm in reply to: savestate / loadstate does not restore collapse / expand state of groups savestate / loadstate does not restore collapse / expand state of groups #80943Just by the way: There is anyway a problem in this demo (/jqxgrid/saveloadstate.htm), if we enable grouping.
Please do the following:
– clear localStorage
– reload demo, click “Save State”
– then group by a column
– click “Load State” -> It should clear the group because we clicked “Save State” as there was no group” but it does not!If we set a break point in “Load State” and observe the state object, we see in the scenario above that the state object contains the group even though it should not (it seems that group by a column will modify the saved state object…)
But if we do astate = $.clone($("#jqxgrid").jqxGrid('savestate'));
and$("#jqxgrid").jqxGrid('loadstate', $.clone(state));
to have the object not modified (if we group by a column), then, at “Load State”, a java script exception is raised from jqWidgets library…December 23, 2015 at 7:48 pm in reply to: Use filter callback of jqxgrid->source Use filter callback of jqxgrid->source #79739What does your answer mean? Does it mean that due to a bug in jqxGrid / jqxDataAdapter we can currently not do what the filter function would have been for? – In the doc is absolutely nothing written that the filter function of source property can only be used for server side filtering.
For the current project, it is impossible to use server filtering – I wrote at the beginning that the data is a local array.I hope that this issue will be solved soon. Thank you very much!
December 23, 2015 at 12:52 pm in reply to: Use filter callback of jqxgrid->source Use filter callback of jqxgrid->source #79713Dear Peter
Thanks for your jsfiddle. But it does not proove, what I discribed as problem. You did not implement an own filter function in the source object.
Please check this one out here: http://jsfiddle.net/2os4j6fL/6/ and you will see that something is wrong with the index as I described.Btw, it is not necessary to post topics from different accounts
Why not? I am working for two different projects and want to strictly separate even the questions here…
Many thanks for your efforts!
December 22, 2015 at 8:37 pm in reply to: Use filter callback of jqxgrid->source Use filter callback of jqxgrid->source #79678Dear Peter
Thanks for your hint. I tried it with getrowdata; but the problem is, that the rowindex in the select event is wrong:
I observe a different behavior of jqx-grid:
A) if an own filter method is provided in the source object, event.args.rowindex in the rowselect event is the index of the selected row out of the filtered rows only
B) if the grid performs the filtering itself (i.e. uncomment my filter method), event.args.rowindex in the rowselect event is the index of the selected row out of all recordsSo I see no way to use getrowdata in the usecase A) (own filter method) to retrieve the right row. Why is the behavior between these two filterings different?
December 22, 2015 at 9:49 am in reply to: Use filter callback of jqxgrid->source Use filter callback of jqxgrid->source #79644Dear jqWidgets team
I still hope that somebody helps me on this. Is it possible to get help before christmas? I would really apreciate it to come a step further in my project.
Many thanks!December 19, 2015 at 4:19 pm in reply to: Use filter callback of jqxgrid->source Use filter callback of jqxgrid->source #79546I still have no idea, what is wrong. I made a minimal example and a video showing the error in the hope that someone will check it out.
You will see that before filtering, selecting a row will correctly display the selected entry. But as soon as I set a filter, the select event provides a wrong row as selected.
<!DOCTYPE html> <html ng-app="demoApp"> <head> <title id="Description">jqxGrid Binding to JSON using AngularJS</title> <link rel="stylesheet" type="text/css" href="../../jqwidgets/styles/jqx.base.css"/> <script type="text/javascript" src="../../scripts/angular.min.js"></script> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqx-all.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript"> var demoApp = angular.module("demoApp", ["jqwidgets"]); demoApp.controller("demoController", function ($scope, $http) { $scope.createWidget = false; $http({ method: 'get', url: '../sampledata/beverages.txt' }).success(function (data, status) { // prepare the data var source = { datatype: "json", datafields: [ {name: 'name', type: 'string'}, {name: 'type', type: 'string'}, {name: 'calories', type: 'int'}, {name: 'totalfat', type: 'string'}, {name: 'protein', type: 'string'} ], id: 'id', localdata: data, filter: function (filtergroups, recordsArray) { var data = []; recordsArray.forEach(function (record) { var add = true; if (angular.isArray(filtergroups)) { filtergroups.forEach(function (filtergroup) { if (angular.isArray(filtergroup.filter.getfilters())) { filtergroup.filter.getfilters().forEach(function (filter) { add = false; var cell = record[filtergroup.datafield]; if (angular.isString(cell)) { cell = cell.toLowerCase(); if (cell.indexOf(filter.value.toLowerCase()) > -1) add = true; var szValue = filter.value.toLowerCase().replace(/ss/g, '\u00DF'); if (cell.indexOf(szValue) > -1) add = true; } }) } }); } if (add) data.push(record); }); return data; } }; var dataAdapter = new $.jqx.dataAdapter(source); $scope.gridSettings = { width: 940, height: 300, source: dataAdapter, columnsresize: true, altrows: true, groupable: true, showgroupsheader: false, sortable: true, filterable: true, showfilterrow: true, columnsresize: true, columnsreorder: true, autoshowfiltericon: true, columnsmenu: false, enabletooltips: true, columns: [ {text: 'Name', datafield: 'name', width: 250}, {text: 'Beverage Type', datafield: 'type', width: 250}, {text: 'Calories', datafield: 'calories', width: 180}, {text: 'Total Fat', datafield: 'totalfat', width: 120}, {text: 'Protein', datafield: 'protein', minwidth: 120} ], rowselect: function (event) { $scope.item = event.args.row; } }; // now create the widget. $scope.createWidget = true; }).error(function (data, status) { // Some error occurred }); }); </script> </head> <body> <div ng-controller="demoController"> <jqx-grid jqx-create="createWidget" jqx-settings="gridSettings"></jqx-grid> <br> <div ng-show="item"> {{item.name}}, {{item.type}}, {{item.calories}}, {{item.totalfat}}, {{item.protein}} </div> </div> </body> </html>
Thanks in advance for your help!
December 15, 2015 at 6:39 am in reply to: Use filter callback of jqxgrid->source Use filter callback of jqxgrid->source #79297Dear all
I would be very happy to get help on this, since I am blocked and have no idea, what I can do to fix this problem. Thank you in advance!December 12, 2015 at 4:12 pm in reply to: Use filter callback of jqxgrid->source Use filter callback of jqxgrid->source #79234Dear Peter
Thank you for your information. I tried, what you have written:
filter: function (filtergroups, recordsArray) { var data = []; recordsArray.forEach(function (record) { var add = true; if (angular.isArray(filtergroups)) { filtergroups.forEach(function (filtergroup) { if (angular.isArray(filtergroup.filter.getfilters())) { filtergroup.filter.getfilters().forEach(function (filter) { add = false; var cell = record[filtergroup.datafield]; if (angular.isString(cell)) { cell = cell.toLowerCase(); if (cell.indexOf(filter.value.toLowerCase()) > -1) add = true; var szValue = filter.value.toLowerCase().replace(/ss/g, '\u00DF'); if (cell.indexOf(szValue) > -1) add = true; } }) } }); } if (add) data.push(record); }); return data; }
The grid (with enabled filterrow) bahves correctly and displays excatly the matching columns. But if I select a row, I get a wrong row item in the selectrow(event) callback of the grid: If I e.g. select the first row of the grid after filtering, event.args.row of the selectrow(event) callback is the same item as if I would have no filtering (i.e. the first row of my data array instead of the first in my array returned in the filter function).
What is wrong?December 10, 2015 at 7:36 am in reply to: jqx-grid: customsort demo and bindingcomplete jqx-grid: customsort demo and bindingcomplete #79160Dear Hristo. Thank you very much! This solves the problem.
Well, the problem is that there are actually some angular demos on your page doing exactly what I have done! So I learn to create always a dataAdapter…Can you explain, what exactly the difference is and why it halfway works? I thought that jqx-grid will create internal always a dataAdapter for the source…
-
AuthorPosts