Commit 3c2acc98 by Uros Spasojevic

implemented add, remove, update, grid

cleanup
parent 88902e28
{"packages":{"classic":{"build":{"dir":"${package.output}"},"creator":"Sencha","namespace":"Ext","type":"toolkit","version":"6.0.1.250"},"cmd":{"current":"6.2.1.29","version":"6.2.2.36"},"core":{"alternateName":["sencha-core"],"creator":"Sencha","type":"code","version":"6.0.1.250"},"ext":{"build":{"dir":"${package.output.base}"},"creator":"Sencha","license":"commercial","namespace":"Ext","resource":{"paths":["resources"]},"type":"framework","version":"6.0.1.250"},"font-awesome":{"creator":"Sencha","namespace":"Ext","resource":{"paths":""},"theme":"theme-neptune","toolkit":"classic","type":"code","version":"6.0.1.250"},"font-ext":{"creator":"Sencha","namespace":"Ext","theme":"theme-neptune","toolkit":"classic","type":"code","version":"6.0.1.250"},"theme-base":{"alternateName":["ext-theme-base"],"creator":"Sencha","namespace":"Ext","toolkit":"classic","type":"theme","version":"6.0.1.250"},"theme-neptune":{"alternateName":["ext-theme-neptune"],"creator":"Sencha","extend":"theme-neutral","namespace":"Ext","toolkit":"classic","type":"theme","version":"6.0.1.250"},"theme-neutral":{"alternateName":["ext-theme-neutral"],"creator":"Sencha","extend":"theme-base","namespace":"Ext","toolkit":"classic","type":"theme","version":"6.0.1.250"},"theme-triton":{"creator":"Sencha","extend":"theme-neptune","fashion":{"inliner":{"enable":false,"maxItemSize":20000,"excludes":[".*\\.woff",".*\\.woff2",".*\\.ttf",".*\\.eot",".*\\.svg"]}},"namespace":"Ext","resource":{"paths":""},"toolkit":"classic","type":"theme","version":"6.0.1.250"},"ux":{"alternateName":["ext-ux"],"creator":"Sencha","namespace":"Ext","resource":{"paths":["${package.dir}/resources","${package.dir}/classic/resources"]},"theme":"theme-classic","toolkit":"classic","type":"code","version":"6.0.1.250"}},"js":[{"path":"classic/app.js"}],"css":[{"exclude":["fashion"],"path":"classic/resources/Evoksi-all.css"}],"cache":{"enable":false,"deltas":"classic/deltas"},"fashion":{"inliner":{"enable":false}},"name":"Evoksi","version":"1.0.0.0","framework":"ext","loader":{"cache":false,"cacheParam":"_dc"},"id":"4cf03061-653c-46bc-9fcb-9c748bb8709d","watch":{"delay":250},"toolkit":"classic","theme":"theme-triton","profile":"classic","hash":"c60443df911d29f0b8b9e485a32f1f75c9ac6667","resources":{"path":"classic/resources","shared":"resources"}} {"packages":{"classic":{"build":{"dir":"${package.output}"},"creator":"Sencha","namespace":"Ext","type":"toolkit","version":"6.0.1.250"},"cmd":{"current":"6.2.1.29","version":"6.2.1.29"},"core":{"alternateName":["sencha-core"],"creator":"Sencha","type":"code","version":"6.0.1.250"},"ext":{"build":{"dir":"${package.output.base}"},"creator":"Sencha","license":"commercial","namespace":"Ext","resource":{"paths":["resources"]},"type":"framework","version":"6.0.1.250"},"font-awesome":{"creator":"Sencha","namespace":"Ext","resource":{"paths":""},"theme":"theme-neptune","toolkit":"classic","type":"code","version":"6.0.1.250"},"font-ext":{"creator":"Sencha","namespace":"Ext","theme":"theme-neptune","toolkit":"classic","type":"code","version":"6.0.1.250"},"theme-base":{"alternateName":["ext-theme-base"],"creator":"Sencha","namespace":"Ext","toolkit":"classic","type":"theme","version":"6.0.1.250"},"theme-neptune":{"alternateName":["ext-theme-neptune"],"creator":"Sencha","extend":"theme-neutral","namespace":"Ext","toolkit":"classic","type":"theme","version":"6.0.1.250"},"theme-neutral":{"alternateName":["ext-theme-neutral"],"creator":"Sencha","extend":"theme-base","namespace":"Ext","toolkit":"classic","type":"theme","version":"6.0.1.250"},"theme-triton":{"creator":"Sencha","extend":"theme-neptune","fashion":{"inliner":{"enable":false,"maxItemSize":20000,"excludes":[".*\\.woff",".*\\.woff2",".*\\.ttf",".*\\.eot",".*\\.svg"]}},"namespace":"Ext","resource":{"paths":""},"toolkit":"classic","type":"theme","version":"6.0.1.250"},"ux":{"alternateName":["ext-ux"],"creator":"Sencha","namespace":"Ext","resource":{"paths":["${package.dir}/resources","${package.dir}/classic/resources"]},"theme":"theme-classic","toolkit":"classic","type":"code","version":"6.0.1.250"}},"js":[{"path":"classic/app.js"}],"css":[{"exclude":["fashion"],"path":"classic/resources/Evoksi-all.css"}],"cache":{"enable":false,"deltas":"classic/deltas"},"fashion":{"inliner":{"enable":false}},"name":"Evoksi","version":"1.0.0.0","framework":"ext","loader":{"cache":false,"cacheParam":"_dc"},"id":"4cf03061-653c-46bc-9fcb-9c748bb8709d","watch":{"delay":250},"toolkit":"classic","theme":"theme-triton","profile":"classic","hash":"3a985e82c832f792715d8e243bd781cf946a1ee8","resources":{"path":"classic/resources","shared":"resources"}}
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
$app-name: dynamic( 'Evoksi' ); $app-name: dynamic( 'Evoksi' );
$image-search-path: '/home/radionica/Desktop/Evoksi/build/development/Evoksi/classic/resources'; $image-search-path: '/Users/uros/workspace/git/Evoksi/build/development/Evoksi/classic/resources';
$theme-name: dynamic( 'theme-triton' ); $theme-name: dynamic( 'theme-triton' );
$include-evoksi-application: dynamic(true);; $include-evoksi-application: dynamic(true);;
$include-evoksi-store-personnel: dynamic(true);; $include-evoksi-store-personnel: dynamic(true);;
...@@ -1461,4 +1461,5 @@ $Evoksi-resource-path: 'images' !default; ...@@ -1461,4 +1461,5 @@ $Evoksi-resource-path: 'images' !default;
$current-package: false; $current-package: false;
$current-resource-root: $Evoksi-resource-root; $current-resource-root: $Evoksi-resource-root;
$relative-image-path-for-uis: $Evoksi-resource-path; $relative-image-path-for-uis: $Evoksi-resource-path;
@import '../../../../../classic/sass/src/view/evoksi/Evoksi';
@import '../../../../../classic/sass/src/view/main/Main'; @import '../../../../../classic/sass/src/view/main/Main';
$app-name: dynamic( 'Evoksi' ); $app-name: dynamic( 'Evoksi' );
$image-search-path: '/home/radionica/Desktop/Evoksi/build/development/Evoksi/classic/resources'; $image-search-path: '/Users/uros/workspace/git/Evoksi/build/development/Evoksi/classic/resources';
$theme-name: dynamic( 'theme-triton' ); $theme-name: dynamic( 'theme-triton' );
$include-evoksi-application: dynamic(true);; $include-evoksi-application: dynamic(true);;
$include-evoksi-store-personnel: dynamic(true);; $include-evoksi-store-personnel: dynamic(true);;
...@@ -1461,4 +1461,5 @@ $Evoksi-resource-path: 'images' !default; ...@@ -1461,4 +1461,5 @@ $Evoksi-resource-path: 'images' !default;
$current-package: false; $current-package: false;
$current-resource-root: $Evoksi-resource-root; $current-resource-root: $Evoksi-resource-root;
$relative-image-path-for-uis: $Evoksi-resource-path; $relative-image-path-for-uis: $Evoksi-resource-path;
@import '../../../../../classic/sass/src/view/evoksi/Evoksi';
@import '../../../../../classic/sass/src/view/main/Main'; @import '../../../../../classic/sass/src/view/main/Main';
Compass.add_project_configuration('../../../../../sass/config.rb') Compass.add_project_configuration('../../../../../sass/config.rb')
cache_path = '/home/radionica/Desktop/Evoksi/build/.sass-cache' cache_path = '/Users/uros/workspace/git/Evoksi/build/.sass-cache'
// @tag full-page // @tag full-page
// @require /home/radionica/Desktop/Evoksi/app.js // @require /Users/uros/workspace/git/Evoksi/app.js
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
.evoksi-view-evoksi {
.#{$prefix}toolbar {
background-color: #d7e9f5;
border: 1px solid #d7e9f5;
@include box-shadow(rgba(0, 0, 0, 0.7) 0 -1px 6px);
.#{$prefix}btn {
background-color: #1b72af;
border: 2px solid #1b72af;
@include border-radius(3px);
.#{$prefix}btn-inner {
color: #fff;
font-weight: bold;
}
&.#{$prefix}btn-pressed,
&.#{$prefix}btn-over,
&.#{$prefix}btn-focus {
background-color: #ebeef0;
@include box-shadow(none);
.#{$prefix}btn-inner {
color: #1b72af;
}
}
}
}
}
.evoksi-window {
border: none;
.#{$prefix}title {
div {
font-weight: bold;
}
}
.#{$prefix}splitter {
background-color: #5fa2dd;
cursor: default;
}
.#{$prefix}panel:first-child {
.gmnoprint {
display: none;
}
}
}
.evoksi-panel-body {
.#{$prefix}panel-body {
background-color: #d7e9f5;
border-color: #d7e9f5;
> div {
margin: auto;
.#{$prefix}field:first-child {
margin-top: 50px;
}
}
}
label {
span {
border-bottom: 2px solid #1b72af;
color: #1b72af;
font-weight: bold;
}
}
.#{$prefix}form-item-body {
padding-left: 10px;
}
.#{$prefix}toolbar {
background-color: #d7e9f5;
border-color: #d7e9f5;
.#{$prefix}btn {
background-color: #1b72af;
border: 2px solid #1b72af;
@include border-radius(3px);
.#{$prefix}btn-inner {
color: #fff;
font-weight: bold;
}
&.#{$prefix}btn-pressed,
&.#{$prefix}btn-over,
&.#{$prefix}btn-focus {
background-color: #ebeef0;
@include box-shadow(none);
.#{$prefix}btn-inner {
color: #1b72af;
}
}
}
.#{$prefix}btn:last-child {
margin-right: 50px;
background-color: #a9364d;
border: 2px solid #a9364d;
@include border-radius(3px);
.#{$prefix}btn-inner {
color: #fff;
font-weight: bold;
}
&.#{$prefix}btn-pressed,
&.#{$prefix}btn-over,
&.#{$prefix}btn-focus {
background-color: #ebeef0;
@include box-shadow(none);
.#{$prefix}btn-inner {
color: #a9364d;
}
}
}
}
.#{$prefix}column-header-text-inner {
&::after {
display: none;
}
}
.#{$prefix}grid {
margin-top: 20px;
}
.#{$prefix}grid-body {
border: 1px solid #d0d0d0;
.#{$prefix}grid-item {
border: none; }
.#{$prefix}grid-item-selected {
background-color: #fce7eb;
border-color: #fce7eb;
}
.#{$prefix}grid-item-focused {
.#{$prefix}grid-cell-inner::before {
border: 1px solid #bf4c63;
}
}
}
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ Ext.define('Evoksi.view.evoksi.Evoksi', { ...@@ -8,6 +8,7 @@ Ext.define('Evoksi.view.evoksi.Evoksi', {
'Evoksi.view.evoksi.EvoksiController', 'Evoksi.view.evoksi.EvoksiController',
'Evoksi.view.evoksi.EvoksiModel' 'Evoksi.view.evoksi.EvoksiModel'
], ],
cls: 'evoksi-view-evoksi',
layout: 'fit', layout: 'fit',
controller: 'evoksi', controller: 'evoksi',
viewModel: 'evoksi', viewModel: 'evoksi',
...@@ -26,8 +27,8 @@ Ext.define('Evoksi.view.evoksi.Evoksi', { ...@@ -26,8 +27,8 @@ Ext.define('Evoksi.view.evoksi.Evoksi', {
items: [ items: [
{ {
xtype: 'button', xtype: 'button',
text: 'Add Marker', text: 'Logout',
handler: 'addNewMarker' handler: 'logout'
} }
] ]
} }
......
...@@ -15,6 +15,9 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -15,6 +15,9 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
component: { component: {
'evoksi': { 'evoksi': {
markerClick: function (marker) { markerClick: function (marker) {
var store = this.getView().getViewModel().getStore('myStore');
var first = true;
store.loadData(marker.performers);
var win = Ext.create('Ext.window.Window', { var win = Ext.create('Ext.window.Window', {
title: marker.title == "" ? "New event" : marker.title, // Marker title title: marker.title == "" ? "New event" : marker.title, // Marker title
height: 600, height: 600,
...@@ -22,6 +25,7 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -22,6 +25,7 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
modal: true, modal: true,
layout: 'border', layout: 'border',
maximizable: true, maximizable: true,
cls: 'evoksi-window',
items: [{ items: [{
xtype: 'gmappanel', xtype: 'gmappanel',
region: 'west', region: 'west',
...@@ -40,57 +44,62 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -40,57 +44,62 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 15 zoom: 15
} }
}, { },
{
xtype: 'panel', xtype: 'panel',
cls: 'evoksi-panel-body',
region: 'center', region: 'center',
layout: 'vbox', layout: 'vbox',
style: 'background-color: white;',
items: [{ items: [{
xtype: 'textfield', xtype: 'textfield',
fieldLabel: 'Title', fieldLabel: 'Title',
reference: 'titleField', reference: 'titleField',
value: marker.title, value: marker.title,
width: '90%' width: '90%'
}, { },
{
xtype: 'textarea', xtype: 'textarea',
fieldLabel: 'Description', fieldLabel: 'Description',
reference: 'descriptionArea', reference: 'descriptionArea',
value: marker.description, value: marker.description,
width: '90%' width: '90%'
}, { },
{
xtype: 'grid', xtype: 'grid',
reference: 'myGrid', reference: 'myGrid',
title: 'Performers', title: 'Performers',
height: 300, height: 300,
width: '90%', width: '90%',
store: this.getView().getViewModel().getStore('myStore'), store: store,
columns: [{ columns: [{
text: 'Name', text: 'Name',
dataIndex: 'name' dataIndex: 'name'
}, { },
{
text: 'Date', text: 'Date',
dataIndex: 'date', dataIndex: 'date',
flex: 1 flex: 1
}, { },
{
text: 'Time', text: 'Time',
dataIndex: 'time', dataIndex: 'time',
flex: 1 flex: 1
}] }]
}], }],
buttons: [{ buttons: [{
text: 'Add', text: 'Add',
handler: function () { handler: function () {
var popup = new Ext.panel.Panel({ var popup = Ext.create('Ext.panel.Panel', {
floating: true, floating: true,
centered: true, centered: true,
title: 'Add performer',
modal: true, modal: true,
width: 300, width: 300,
height: 400, height: 400,
draggable: false,
maximizable: false,
items: [ items: [
{ {
xtype: 'textfield', xtype: 'textfield',
...@@ -112,25 +121,60 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -112,25 +121,60 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
formBind: true, formBind: true,
listeners: { listeners: {
click: function() { click: function() {
// record.beginEdit(); if(first) {
// record.set("name", popup.items.items[0].value); store.each(function(item) {
// record.set("date", popup.items.items[1].value); var dat = {
// record.set("time", popup.items.items[2].value); name: item.data.name,
// record.endEdit(); date: item.data.date,
time: item.data.time
};
store.insert(0, dat);
});
first = false;
}
var newPerformer = {
name: popup.items.items[0].value,
date: popup.items.items[1].value,
time: popup.items.items[2].value
}
store.insert(0, newPerformer);
popup.hide(); popup.hide();
} }
} }
}] }]
}).show();
}).show()
} }
}, },
{ {
text: 'Update', text: 'Update',
handler: function () { handler: function () {
console.log('updating'); var perf = [];
store.each(function (rec) {
perf.push(rec.data);
}
);
var newMarker = {
title: win.items.items[2].items.items[0].value,
description: win.items.items[2].items.items[1].value,
performers: perf,
lat: marker.lat,
lng: marker.lng,
animation: google.maps.Animation.DROP,
access: marker.access
};
var updates = {};
updates['/data/' + newMarker.access] = newMarker;
dbref.ref().update(updates);
win.hide();
} }
}, { },
{
text: 'Delete', text: 'Delete',
handler: function () { handler: function () {
var i = markers.length; var i = markers.length;
...@@ -150,19 +194,14 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -150,19 +194,14 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
win.close(); win.close();
} }
}] }]
} }]
] }).show();
}).
show()
}, },
click: function (evt) { click: function (evt) {
var me = this; var me = this,
var map = me.getView(); map = me.getView(),
var key = dbref.ref().child('data').push().key; key = dbref.ref().child('data').push().key,
marker = {
var marker = {
access: key, access: key,
lat: evt.latLng.lat(), lat: evt.latLng.lat(),
lng: evt.latLng.lng(), lng: evt.latLng.lng(),
...@@ -172,11 +211,6 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -172,11 +211,6 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
animation: google.maps.Animation.DROP animation: google.maps.Animation.DROP
}; };
this.getView().getViewModel().getStore('myStore').each(function (rec) {
marker.performers.push(rec.data);
}
);
var updates = {}; var updates = {};
updates['/data/' + key] = marker; updates['/data/' + key] = marker;
...@@ -185,11 +219,6 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -185,11 +219,6 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
markers.push(map.addMarker(marker)); markers.push(map.addMarker(marker));
}, },
updateData: function (marker) {
// stub
},
mapready: function () { mapready: function () {
var me = this; var me = this;
var map = me.getView(); var map = me.getView();
...@@ -211,18 +240,15 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -211,18 +240,15 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
} }
}); });
} }
} }
} }
} }
}, },
logout: function() {
console.log('logout');
},
init: function () { init: function () {
var me = this, var me = this,
map = me.getView(); map = me.getView();
} }
}); });
\ No newline at end of file
...@@ -6,21 +6,7 @@ Ext.define('Evoksi.view.evoksi.EvoksiModel', { ...@@ -6,21 +6,7 @@ Ext.define('Evoksi.view.evoksi.EvoksiModel', {
StoreId: 'myStore', StoreId: 'myStore',
fields: [ fields: [
'name', 'date', 'time' 'name', 'date', 'time'
],
data: {
items: [
{name: 'aaa', date: 'sdfgsdfg', time: 'fsadfsa'}
] ]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
rootProperty: 'items'
}
}
} }
} }
}); });
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment