Get ready for BLACK FRIDAY shopping starting in

HTML5 Data Bindings Formatter Support Product Page

In progress

Reverse ordering after apply Group by filter in Internet Explorer and Safari

Reported 11 Jan 2015 09:00:31
1
has this problem
11 Jan 2015 09:00:31 Luigi Di Risio posted:
Hello,
i have a problem with sorting data after apply 'groupBy' filter.
I have a database source named 'Portfolio' order by anno DESC.
When I bind my <div> with this datasource and apply the filter 'groupBy':

<div data-binding-id="repeat1" data-binding-repeat="{{dsPortfolio.data.groupBy( &quot;anno&quot; )}}"">
{{$name}}
</div>

with Mozilla Firefox i see this (correct sorting)

2015
2014
2013
2011

but, with Internet Explorer and Safari i see the reverse ordering:

2011
2013
2014
2015

Regards,
Luigi Di Risio

Replies

Replied 13 Jan 2015 12:28:43
13 Jan 2015 12:28:43 Teodor Kuduschiev replied:
Hello Luigi,
Please define the sort order in the database source query builder. Add the column you want to sort by and select ASC/ DESC order.
Replied 14 Jan 2015 10:41:24
14 Jan 2015 10:41:24 Luigi Di Risio replied:
Hello Teodor,
i define already the sort order in the database source query builder.

I show you my test scenario:

1) MySql table 'test'

-- ----------------------------
-- Table structure for test
-- ----------------------------
DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (
`test_id` int(11) NOT NULL AUTO_INCREMENT,
`test_anno` int(11) DEFAULT NULL,
PRIMARY KEY (`test_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of test
-- ----------------------------
INSERT INTO `test` VALUES ('1', '2013');
INSERT INTO `test` VALUES ('2', '2010');
INSERT INTO `test` VALUES ('3', '2015');
INSERT INTO `test` VALUES ('4', '2013');
INSERT INTO `test` VALUES ('5', '2013');
INSERT INTO `test` VALUES ('6', '2014');
INSERT INTO `test` VALUES ('7', '2012');
INSERT INTO `test` VALUES ('8', '2015');



2. DmxConnections file

[...]
var dmxConnectionMeta = //<<<JSON
{"allTables": ["test"], "allViews": [], "tables": {"test": {"columns": {"test_id": {"type": 3, "nullable": 1, "defaultValue": "0", "primary": 1}, "test_anno": {"type": 3, "nullable": 1}}, "keys": {"PRIMARY": ["test_id"]}}}}
//JSON
;
</script>



3. I sort column 'test_anno' dmxDatabaseSources/dsTest.asp


[...]
var cfg = //<<<JSON
{"type": "select", "table": "test", "columns": [{"table": "test", "column": "*", "alias": "", "sortable": false}], "wheres": [], "orders": [{"table": "test", "column": "test_anno", "direction": "DESC"}], "joins": []}
//JSON
;
var connection = new SqlConnection();
connection.execute(SqlBuilder(cfg), true);
</script>



4. The test page test.html

<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<title>Test</title>
<link rel="stylesheet" type="text/css" href="/bootstrap/3/css/bootstrap.css" />
<script type="text/javascript" src="/ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="/bootstrap/3/js/bootstrap.js"></script>
<script type="text/javascript" src="/ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="/ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript">
/* dmxDataSet name "dsTestAnno" */
jQuery.dmxDataSet(
{"id": "dsTestAnno", "url": "dmxDatabaseSources/dsTest.asp", "data": {"limit": "25"}, "dataSourceType": "database", "dataType": "jsonp"}
);
/* END dmxDataSet name "dsTestAnno" */
</script>
<script type="text/javascript" src="/ScriptLibrary/dmxDataFilters.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div data-binding-id="repeat1" data-binding-repeat="{{dsTestAnno.data.groupBy( &quot;test_anno&quot; )}}">{{$name}}</div>
</div>
</div>
</div>
</body>
</html>


you can check here:
http:www.luigidirisio.it/test.html

If I open with Mozilla I have right sorting, but with Internet Explorer this is opposite

----- EDIT----
The opposite sorting have with Internet Explorer 9, 10 and 11
Good sorting with Internet Explorer 8
------------------


Thanks,
Luigi Di Risio

Reply to this topic