Skip to content

Commit

Permalink
[client-user] TemplateView : SelectionModel improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Fiorito committed Nov 9, 2016
1 parent ad8df0d commit 859bcf4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Ext.define('sitools.user.controller.component.datasets.dataviews.TemplateViewCon

templateView.primaryKeyValue = encodeURIComponent(templateView.primaryKeyValue);

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

//destroy all selections if all was selected and another row is selected
if ((templateView.isAllSelected() && recs.length === DEFAULT_LIVEGRID_BUFFER_SIZE - 1) ||
(templateView.isAllSelected() && pageData.currentPage === pageData.pageCount)) { // if last page and less than DEFAULT_LIVEGRID_BUFFER_SIZE number of records
if (templateView.isAllSelected()) {
templateView.selectAllRowsBtn.toggle();
templateView.deselectAll();
var unselectedRec = templateView.getUnselectedRow(recs, templateView.store.data.items);
templateView.select(unselectedRec);
templateView.select(rec);
}
},
newdataloaded: function (dataView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ Ext.define('sitools.user.view.component.datasets.dataviews.TemplateViewView', {

initComponent: function () {

this.urlRecords = this.dataset.sitoolsAttachementForUsers;

this.columnModel = getColumnModel(this.dataset.columnModel);

this.origin = "sitools.user.view.component.datasets.dataviews.TemplateViewView";
Expand Down Expand Up @@ -225,7 +223,7 @@ Ext.define('sitools.user.view.component.datasets.dataviews.TemplateViewView', {
border: false,
primaryKeyName: this.store.primaryKey,
grid: this,
baseUrl: this.dataset.sitoolsAttachementForUsers,
baseUrl: this.dataset.sitoolsAttachementForUsers + '/records/',
boxMinWidth: 200,
width: 500
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Ext.define('sitools.user.view.component.datasets.recordDetail.RecordDetailView',

this.primaryKeyValue = this.recSelected.get(this.primaryKeyName);
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
this.url = this.baseUrl + 'records/' + this.primaryKeyValue;
this.url = this.baseUrl + this.primaryKeyValue;

break;

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

this.primaryKeyValue = this.recSelected.get(this.primaryKeyName);
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
this.url = this.baseUrl + 'records/' + this.primaryKeyValue;
this.url = this.baseUrl + this.primaryKeyValue;
break;
}

Expand Down Expand Up @@ -476,7 +476,7 @@ Ext.define('sitools.user.view.component.datasets.recordDetail.RecordDetailView',
}
this.primaryKeyValue = nextRec.get(this.primaryKeyName);
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
this.url = this.baseUrl + '/records/' + this.primaryKeyValue;
this.url = this.baseUrl + this.primaryKeyValue;
this.recSelected = nextRec;
this.grid.select(nextRec, false, true);
//this.expand();
Expand Down Expand Up @@ -528,7 +528,7 @@ Ext.define('sitools.user.view.component.datasets.recordDetail.RecordDetailView',
}
this.primaryKeyValue = nextRec.get(this.primaryKeyName);
this.primaryKeyValue = encodeURIComponent(this.primaryKeyValue);
this.url = this.baseUrl + '/records/' + this.primaryKeyValue;
this.url = this.baseUrl + this.primaryKeyValue;
this.recSelected = nextRec;
this.grid.select(nextRec, false, true);
this.expand();
Expand Down

0 comments on commit 859bcf4

Please sign in to comment.