Skip to content

Commit 859bcf4

Browse files
author
Bastien Fiorito
committed
[client-user] TemplateView : SelectionModel improvements
1 parent ad8df0d commit 859bcf4

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

workspace/client-user-3.0/app/controller/component/datasets/dataviews/TemplateViewController.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Ext.define('sitools.user.controller.component.datasets.dataviews.TemplateViewCon
5454

5555
templateView.primaryKeyValue = encodeURIComponent(templateView.primaryKeyValue);
5656

57-
var url = templateView.urlRecords + "/records/" + templateView.primaryKeyValue;
57+
var url = templateView.dataset.sitoolsAttachementForUsers + "/records/" + templateView.primaryKeyValue;
5858
Ext.apply(templateView.panelDetail, {
5959
url: url
6060
});
@@ -65,12 +65,10 @@ Ext.define('sitools.user.controller.component.datasets.dataviews.TemplateViewCon
6565
var pageData = templateView.down('pagingtoolbar').getPageData();
6666

6767
//destroy all selections if all was selected and another row is selected
68-
if ((templateView.isAllSelected() && recs.length === DEFAULT_LIVEGRID_BUFFER_SIZE - 1) ||
69-
(templateView.isAllSelected() && pageData.currentPage === pageData.pageCount)) { // if last page and less than DEFAULT_LIVEGRID_BUFFER_SIZE number of records
68+
if (templateView.isAllSelected()) {
7069
templateView.selectAllRowsBtn.toggle();
7170
templateView.deselectAll();
72-
var unselectedRec = templateView.getUnselectedRow(recs, templateView.store.data.items);
73-
templateView.select(unselectedRec);
71+
templateView.select(rec);
7472
}
7573
},
7674
newdataloaded: function (dataView) {

workspace/client-user-3.0/app/view/component/datasets/dataviews/TemplateViewView.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ Ext.define('sitools.user.view.component.datasets.dataviews.TemplateViewView', {
4444

4545
initComponent: function () {
4646

47-
this.urlRecords = this.dataset.sitoolsAttachementForUsers;
48-
4947
this.columnModel = getColumnModel(this.dataset.columnModel);
5048

5149
this.origin = "sitools.user.view.component.datasets.dataviews.TemplateViewView";
@@ -225,7 +223,7 @@ Ext.define('sitools.user.view.component.datasets.dataviews.TemplateViewView', {
225223
border: false,
226224
primaryKeyName: this.store.primaryKey,
227225
grid: this,
228-
baseUrl: this.dataset.sitoolsAttachementForUsers,
226+
baseUrl: this.dataset.sitoolsAttachementForUsers + '/records/',
229227
boxMinWidth: 200,
230228
width: 500
231229
});

workspace/client-user-3.0/app/view/component/datasets/recordDetail/RecordDetailView.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Ext.define('sitools.user.view.component.datasets.recordDetail.RecordDetailView',
6666

6767
this.primaryKeyValue = this.recSelected.get(this.primaryKeyName);
6868
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
69-
this.url = this.baseUrl + 'records/' + this.primaryKeyValue;
69+
this.url = this.baseUrl + this.primaryKeyValue;
7070

7171
break;
7272

@@ -93,7 +93,7 @@ Ext.define('sitools.user.view.component.datasets.recordDetail.RecordDetailView',
9393

9494
this.primaryKeyValue = this.recSelected.get(this.primaryKeyName);
9595
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
96-
this.url = this.baseUrl + 'records/' + this.primaryKeyValue;
96+
this.url = this.baseUrl + this.primaryKeyValue;
9797
break;
9898
}
9999

@@ -476,7 +476,7 @@ Ext.define('sitools.user.view.component.datasets.recordDetail.RecordDetailView',
476476
}
477477
this.primaryKeyValue = nextRec.get(this.primaryKeyName);
478478
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
479-
this.url = this.baseUrl + '/records/' + this.primaryKeyValue;
479+
this.url = this.baseUrl + this.primaryKeyValue;
480480
this.recSelected = nextRec;
481481
this.grid.select(nextRec, false, true);
482482
//this.expand();
@@ -528,7 +528,7 @@ Ext.define('sitools.user.view.component.datasets.recordDetail.RecordDetailView',
528528
}
529529
this.primaryKeyValue = nextRec.get(this.primaryKeyName);
530530
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
531-
this.url = this.baseUrl + '/records/' + this.primaryKeyValue;
531+
this.url = this.baseUrl + this.primaryKeyValue;
532532
this.recSelected = nextRec;
533533
this.grid.select(nextRec, false, true);
534534
this.expand();

0 commit comments

Comments
 (0)