From ec45ab8d905e0cd43827048842ac186660e1b9d6 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 20 Dec 2016 18:23:02 +0300 Subject: [PATCH] [SSE mobile] repaired Sort&Filter page --- .../mobile/app/controller/add/AddOther.js | 18 ++++++++++++++++++ .../mobile/app/template/AddOther.template | 2 +- .../mobile/app/view/add/AddOther.js | 12 ++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js index 0ae1073ca..3e781a518 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js @@ -68,6 +68,8 @@ define([ 'page:show' : this.onPageShow , 'link:insert': this.onInsertLink , 'image:insert': this.onInsertImage + , 'insert:sort': this.onInsertSort + , 'insert:filter': this.onInsertFilter , 'link:changetype': this.onChangeLinkType , 'link:changesheet': this.onChangeLinkSheet } @@ -128,6 +130,10 @@ define([ view.optionAllowInternal(allowinternal); allowinternal && view.optionLinkType( this.optsLink.type ); } else + if (pageId == '#addother-sort') { + var filterInfo = this.api.asc_getCellInfo().asc_getAutoFilterInfo(); + view.optionAutofilter( filterInfo ? filterInfo.asc_getIsAutoFilter() : null) + } else if (pageId == '#addother-change-linktype') { view.optionLinkType( this.optsLink.type ); } @@ -214,6 +220,18 @@ define([ } }, + onInsertSort: function(type) { + this.api.asc_sortColFilter(type == 'down' ? Asc.c_oAscSortOptions.Ascending : Asc.c_oAscSortOptions.Descending, ''); + }, + + onInsertFilter: function(checked) { + var formatTableInfo = this.api.asc_getCellInfo().asc_getFormatTableInfo(); + var tablename = (formatTableInfo) ? formatTableInfo.asc_getTableName() : undefined; + if (checked) + this.api.asc_addAutoFilter(); else + this.api.asc_changeAutoFilter(tablename, Asc.c_oAscChangeFilterOptions.filter, checked); + }, + textInvalidRange: 'ERROR! Invalid cells range', textEmptyImgUrl : 'You need to specify image URL.', txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"' diff --git a/apps/spreadsheeteditor/mobile/app/template/AddOther.template b/apps/spreadsheeteditor/mobile/app/template/AddOther.template index f7f18e9ba..71a39d8c8 100644 --- a/apps/spreadsheeteditor/mobile/app/template/AddOther.template +++ b/apps/spreadsheeteditor/mobile/app/template/AddOther.template @@ -240,7 +240,7 @@