commit 1ecdb4d4bd34d492c4ddcace60865ef941b7d456
parent 1b3a11ebe4436fde76577164addaff2b811db476
Author: Timo A. Hummel <felicitus@felicitus.org>
Date: Fri, 13 Apr 2018 15:48:42 +0200
Added more PartKeepr mobile proof of concept things including grid headers and toolbar
Diffstat:
3 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css b/src/PartKeepr/FrontendBundle/Resources/public/css/PartKeepr.css
@@ -210,6 +210,7 @@ margin-left: -75px;
height: 22px !important;
width: 112px !important;
background-image: url(../images/partkeepr-header.png);
+ background-repeat: no-repeat;
}
.patreonLogo {
diff --git a/src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js b/src/PartKeepr/MobileFrontendBundle/Resources/public/js/PartKeeprMobile.js
@@ -30,33 +30,57 @@ Ext.application({
autoSync: false, // Do not change. If true, new (empty) records would be immediately committed to the database.
remoteFilter: true,
remoteSort: true,
- pageSize: 15
+ pageSize: 50,
+ groupField: 'categoryPath',
+ sorters: [
+ {
+ property: 'category.categoryPath',
+ direction: 'ASC'
+ },
+ {
+ property: 'name',
+ direction: 'ASC'
+ }
+ ]
};
var store = Ext.create("Ext.data.Store", config);
- Ext.create('Ext.grid.Grid', {
- title: 'PartKeepr: Parts List',
+ var grid = Ext.create('Ext.grid.Grid', {
store: store,
+ grouped: true,
+ features: [{ftype: 'grouping', groupHeaderTpl: 'Subject: {name}'}],
+
columns: [
{
+ text: 'Name',
+ hidden: true,
+ dataIndex: "categoryPath",
+ flex: 1,
+ // Adjust the header text when grouped by this column:
+ },
+ {
text: i18n("Name"),
dataIndex: 'name',
flex: 1,
minWidth: 150
- }, {
- text: i18n("Description"),
- dataIndex: 'description',
- flex: 2,
- minWidth: 150
- }, {
- text: i18n("Storage Location"),
- dataIndex: 'storageLocation.name'
}
],
+
+ });
+
+ var panel = Ext.create("Ext.panel.Panel", {
+ title: 'Parts List',
+ iconCls: 'partkeeprLogo',
+ tools: [
+ {type: 'refresh'},
+ {type: 'search'},
+ {type: 'menu'}
+ ],
+ items: [grid],
layout: 'fit',
fullscreen: true
});
diff --git a/src/PartKeepr/MobileFrontendBundle/Resources/views/index.html.twig b/src/PartKeepr/MobileFrontendBundle/Resources/views/index.html.twig
@@ -20,7 +20,7 @@
<!-- Include the ExtJS CSS Theme -->
{% stylesheets
filter='cssrewrite'
- 'js/packages/extjs6/build/modern/theme-triton/resources/theme-triton-all.css'
+ 'js/packages/extjs6/build/modern/theme-material/resources/theme-material-all.css'
'atelierspierrot/famfamfam-silk-sprite/silk-icons-sprite.css'
'spritesheets/fugue-16.css'
'spritesheets/partkeepr.css'