source upload
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Using mORMot with ExtJS >> by warleyalex</title>
|
||||
<script src="http://extjs.cachefly.net/ext-4.0.7-gpl/ext-all.js"></script>
|
||||
<link rel="stylesheet" href="http://extjs.cachefly.net/ext-4.0.7-gpl/resources/css/ext-all.css">
|
||||
<link rel="stylesheet" href="resources/css/app.css">
|
||||
<script type="text/javascript" src="app.js?_dc=1347109314941"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="warleyalex"></div>
|
||||
<div id="dr"><br></div>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,14 @@
|
||||
Ext.Ajax.useDefaultXhrHeader = false;
|
||||
Ext.Ajax.cors = true;
|
||||
|
||||
Ext.Loader.setConfig({
|
||||
enabled : true
|
||||
});
|
||||
|
||||
Ext.application({
|
||||
autoCreateViewport : true,
|
||||
name : 'ExtMVC',
|
||||
controllers : [
|
||||
'Contacts'
|
||||
]
|
||||
});
|
@@ -0,0 +1,283 @@
|
||||
Ext.define('ExtMVC.controller.Contacts', {
|
||||
extend : 'Ext.app.Controller',
|
||||
|
||||
models : [
|
||||
'Contact'
|
||||
],
|
||||
stores : [
|
||||
'Contacts'
|
||||
],
|
||||
views : [
|
||||
'contact.Grid',
|
||||
'contact.Edit',
|
||||
'contact.Filtro'
|
||||
],
|
||||
|
||||
refs : [{
|
||||
ref : 'contactGrid',
|
||||
selector : 'contactgrid',
|
||||
xtype : 'gridpanel'
|
||||
}, {
|
||||
ref : 'contatoFiltro',
|
||||
xtype : 'contatofiltro',
|
||||
selector : 'contatofiltro'
|
||||
}, {
|
||||
ref : 'contatoFiltrod',
|
||||
xtype : 'contatofiltrod',
|
||||
selector : 'contatofiltrod'
|
||||
}
|
||||
],
|
||||
|
||||
dblClickEdit : function (dataview, record, item, index, e, options) {
|
||||
var edit = Ext.create('ExtMVC.view.contact.Edit');
|
||||
if (record) {
|
||||
edit.down('form').loadRecord(record);
|
||||
}
|
||||
|
||||
var grid = this.getContactGrid();
|
||||
var rec = grid.getSelectionModel().getSelection();
|
||||
|
||||
},
|
||||
|
||||
onButtonClickAdd : function (button, e, options) {
|
||||
this.dblClickEdit();
|
||||
},
|
||||
|
||||
onButtonClickDelete : function (button, e, options) {
|
||||
var grid = this.getContactGrid(),
|
||||
record = grid.getSelectionModel().getSelection();
|
||||
cont = grid.getSelectionModel().getSelection()[0].data.Name;
|
||||
store = this.getContactsStore();
|
||||
|
||||
Ext.MessageBox.show({
|
||||
title : 'Delete Record',
|
||||
buttons : Ext.MessageBox.YESNO,
|
||||
msg : 'Delete this record ' + cont + '?',
|
||||
icon : Ext.Msg.WARNING,
|
||||
fn : function (btn) {
|
||||
if (btn == 'yes') {
|
||||
store.remove(record);
|
||||
store.sync({
|
||||
success : function () {
|
||||
store.load();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
onButtonClickSave : function (button, e, options) {
|
||||
var win = button.up('window'),
|
||||
form = win.down('form'),
|
||||
record = form.getRecord();
|
||||
values = form.getValues();
|
||||
store = this.getContactsStore();
|
||||
var isNew = false;
|
||||
if (values.ID > 0) {
|
||||
record.set(values);
|
||||
} else {
|
||||
Ext.Ajax.on("beforerequest", function( conn, options, eOpts){
|
||||
if (options.action=='create')
|
||||
{
|
||||
var newData = values;
|
||||
delete newData.ID;
|
||||
options.jsonData = newData;
|
||||
}
|
||||
});
|
||||
record = Ext.create('ExtMVC.model.Contact');
|
||||
record.set(values);
|
||||
store.add(record);
|
||||
isNew = true;
|
||||
}
|
||||
win.close();
|
||||
|
||||
Ext.MessageBox.show({
|
||||
title : 'Save Record',
|
||||
buttons : Ext.MessageBox.YESNO,
|
||||
msg : 'Save this record?',
|
||||
icon : Ext.Msg.WARNING,
|
||||
fn : function (btn) {
|
||||
if (btn == 'yes') {
|
||||
store.sync({
|
||||
success : function () {
|
||||
if (isNew) {
|
||||
store.load();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onButtonClickCancel : function (button, e, options) {
|
||||
var win = button.up('window'),
|
||||
form = win.down('form');
|
||||
form.getForm().reset();
|
||||
win.close();
|
||||
},
|
||||
|
||||
loadFilter : function (button) {
|
||||
var win = Ext.widget('contatofiltro');
|
||||
win.show();
|
||||
},
|
||||
|
||||
setFilter : function (btn) {
|
||||
var me = this;
|
||||
var win = btn.up('contatofiltro');
|
||||
var item = win.down('form').getValues();
|
||||
var store = me.getContactsStore();
|
||||
store.remoteFilter = false;
|
||||
store.clearFilter();
|
||||
store.remoteFilter = true;
|
||||
store.getProxy().extraParams = {
|
||||
where : 'Name LIKE :("' + Ext.getCmp("Fname").value + '%"): AND TimeD=:("' + Ext.Date.format(Ext.getCmp("Ftime").value, "Y-m-d") + '"):'
|
||||
};
|
||||
|
||||
var obj = item
|
||||
for (var prop in obj) {
|
||||
var xname = obj.name;
|
||||
var xphone = obj.timed;
|
||||
var xemail = obj.question;
|
||||
}
|
||||
store.filter([
|
||||
Ext.create('Ext.util.Filter', {property : "Name", value : xname,root : 'values'}),
|
||||
Ext.create('Ext.util.Filter', {property : "TimeD", value : xphone,root : 'values'}),
|
||||
Ext.create('Ext.util.Filter', {property : "Question", value : xemail,root : 'values'})
|
||||
]);
|
||||
},
|
||||
|
||||
reset : function (btn) {
|
||||
var win = btn.up('contatofiltro');
|
||||
win.down('form').getForm().reset();
|
||||
Ext.getCmp('mygrid').getStore().getProxy().extraParams = '';
|
||||
Ext.getCmp('mygrid').getStore().load();
|
||||
},
|
||||
|
||||
loadFilterData : function (button) {
|
||||
var win = Ext.widget('contatofiltrod');
|
||||
win.show();
|
||||
},
|
||||
|
||||
setFilterData : function (btn) {
|
||||
var me = this;
|
||||
var win = btn.up('contatofiltrod');
|
||||
var item = win.down('form').getValues();
|
||||
var store = me.getContactsStore();
|
||||
store.remoteFilter = false;
|
||||
store.clearFilter();
|
||||
store.remoteFilter = true;
|
||||
store.getProxy().extraParams = {
|
||||
where : 'TimeD BETWEEN :("' + Ext.Date.format(Ext.getCmp("startdt").value, "Y-m-d") + '"): AND :("' + Ext.Date.format(Ext.getCmp("enddt").value, "Y-m-d") + '"):'
|
||||
};
|
||||
var obj = item
|
||||
for (var prop in obj) {
|
||||
var xphone = obj.timed;
|
||||
}
|
||||
store.filter([
|
||||
Ext.create('Ext.util.Filter', {
|
||||
property : "TimeD",
|
||||
value : xphone,
|
||||
root : 'values'
|
||||
})
|
||||
]);
|
||||
},
|
||||
|
||||
deleteRange : function (btn) {
|
||||
var me = this;
|
||||
var win = btn.up('contatofiltrod');
|
||||
var item = win.down('form').getValues();
|
||||
var store = me.getContactsStore();
|
||||
store.remoteFilter = false;
|
||||
store.clearFilter();
|
||||
store.remoteFilter = true;
|
||||
store.getProxy().extraParams = {
|
||||
where : 'TimeD BETWEEN :("' + Ext.Date.format(Ext.getCmp("startdt").value, "Y-m-d") + '"): AND :("' + Ext.Date.format(Ext.getCmp("enddt").value, "Y-m-d") + '"):'
|
||||
};
|
||||
var obj = item
|
||||
for (var prop in obj) {
|
||||
var xphone = obj.timed;
|
||||
}
|
||||
store.filter([
|
||||
Ext.create('Ext.util.Filter', {
|
||||
property : "TimeD",
|
||||
value : xphone,
|
||||
root : 'values'
|
||||
})
|
||||
]);
|
||||
|
||||
Ext.MessageBox.show({
|
||||
title : 'Delete Record',
|
||||
buttons : Ext.MessageBox.YESNO,
|
||||
msg : 'Delete Selection Records',
|
||||
icon : Ext.Msg.WARNING,
|
||||
fn : function (btn) {
|
||||
if (btn == 'yes') {
|
||||
Ext.Ajax.request({
|
||||
url : ((store.getProxy().api.read + '&where=' + store.getProxy().extraParams.where)),
|
||||
method : 'DELETE',
|
||||
scope : this
|
||||
});
|
||||
store.sync({
|
||||
success : function () {
|
||||
store.load();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
resetData : function (btn) {
|
||||
var win = btn.up('contatofiltrod');
|
||||
win.down('form').getForm().reset();
|
||||
Ext.getCmp('mygrid').getStore().getProxy().extraParams = '';
|
||||
Ext.getCmp('mygrid').getStore().load();
|
||||
win.close();
|
||||
},
|
||||
|
||||
init : function (application) {
|
||||
this.control({
|
||||
"contactgrid dataview" : {
|
||||
itemdblclick : this.dblClickEdit
|
||||
},
|
||||
"contactgrid button[action=add]": {
|
||||
click: this.onButtonClickAdd
|
||||
},
|
||||
"contactgrid button[action=delete]" : {
|
||||
click : this.onButtonClickDelete
|
||||
},
|
||||
"contactform button[action=save]" : {
|
||||
click : this.onButtonClickSave
|
||||
},
|
||||
"contactform button[action=cancel]" : {
|
||||
click : this.onButtonClickCancel
|
||||
},
|
||||
"contactgrid button[action=filtrar]" : {
|
||||
click : this.loadFilter
|
||||
},
|
||||
"contatofiltro button[action=filtrar_busca]" : {
|
||||
click : this.setFilter
|
||||
},
|
||||
"contatofiltro button[action=reset]" : {
|
||||
click : this.reset
|
||||
},
|
||||
"contactgrid button[action=filtrar_name]" : {
|
||||
click : this.loadFilterData
|
||||
},
|
||||
"contatofiltrod button[action=filtrar_buscad]" : {
|
||||
click : this.setFilterData
|
||||
},
|
||||
"contatofiltrod button[action=deleterange]" : {
|
||||
click : this.deleteRange
|
||||
},
|
||||
"contatofiltrod button[action=resetd]" : {
|
||||
click : this.resetData
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
@@ -0,0 +1,19 @@
|
||||
Ext.define('ExtMVC.model.Contact', {
|
||||
extend : 'Ext.data.Model',
|
||||
idProperty : 'ID',
|
||||
totalproperty : 'total',
|
||||
fields : [{
|
||||
name : 'ID',
|
||||
type : 'int'
|
||||
}, {
|
||||
name : 'TimeD',
|
||||
type : 'datetime'
|
||||
}, {
|
||||
name : 'Name',
|
||||
type : 'string'
|
||||
}, {
|
||||
name : 'Question',
|
||||
type : 'string'
|
||||
}
|
||||
]
|
||||
});
|
@@ -0,0 +1,44 @@
|
||||
Ext.define('ExtMVC.store.Contacts', {
|
||||
extend : 'Ext.data.Store',
|
||||
requires : ['ExtMVC.model.Contact'],
|
||||
constructor : function (cfg) {
|
||||
var me = this;
|
||||
cfg = cfg || {};
|
||||
me.callParent([Ext.apply({
|
||||
autoLoad : true,
|
||||
storeId : 'contactsStore',
|
||||
model : 'ExtMVC.model.Contact',
|
||||
pageSize : 10,
|
||||
totalproperty : 'records',
|
||||
remoteSort : true,
|
||||
remoteFilter : false,
|
||||
proxy : {
|
||||
type : 'rest',
|
||||
simpleSortMode : true,
|
||||
directionParam : "dir",
|
||||
sortParam : "sort",
|
||||
noCache : false,
|
||||
actionMethods : {
|
||||
create : 'POST',
|
||||
read : 'GET',
|
||||
update : 'PUT',
|
||||
destroy : 'DELETE'
|
||||
},
|
||||
api : {
|
||||
create : 'http://localhost:8080/root/SampleRecord',
|
||||
read : 'http://localhost:8080/root/SampleRecord/?SELECT=*',
|
||||
update : 'http://localhost:8080/root/SampleRecord/',
|
||||
destroy : 'http://localhost:8080/root/SampleRecord/'
|
||||
},
|
||||
reader : {
|
||||
type : 'json',
|
||||
root : 'values'
|
||||
},
|
||||
writer : {
|
||||
type : 'json',
|
||||
encode : false
|
||||
},
|
||||
}
|
||||
}, cfg)]);
|
||||
}
|
||||
});
|
@@ -0,0 +1,10 @@
|
||||
Ext.define('ExtMVC.view.Viewport', {
|
||||
extend : 'ExtMVC.view.contact.Grid',
|
||||
renderTo : Ext.getBody(),
|
||||
requires : [
|
||||
'ExtMVC.view.contact.Grid',
|
||||
'ExtMVC.view.contact.Edit',
|
||||
'ExtMVC.view.contact.Filtro',
|
||||
'ExtMVC.view.contact.Filtrod'
|
||||
]
|
||||
});
|
@@ -0,0 +1,86 @@
|
||||
Ext.require([
|
||||
'Ext.util.*'
|
||||
]);
|
||||
|
||||
Ext.define('ExtMVC.view.contact.Edit', {
|
||||
extend : 'Ext.window.Window',
|
||||
alias : 'widget.contactform',
|
||||
id: 'contactform',
|
||||
autoShow : true,
|
||||
height : 168,
|
||||
width : 398,
|
||||
layout : {
|
||||
type : 'fit'
|
||||
},
|
||||
iconCls : 'icon-user',
|
||||
title : 'Create/Edit SampleRecord',
|
||||
initComponent : function () {
|
||||
var me = this;
|
||||
|
||||
Ext.applyIf(me, {
|
||||
items : [{
|
||||
xtype : 'form',
|
||||
style : 'background-color: #fff;',
|
||||
bodyPadding : 10,
|
||||
items : [{
|
||||
xtype : 'hiddenfield',
|
||||
anchor : '100%',
|
||||
name : 'ID',
|
||||
fieldLabel : 'Label'
|
||||
}, {
|
||||
xtype : 'textfield',
|
||||
anchor : '100%',
|
||||
id : 'FnameE',
|
||||
name : 'Name',
|
||||
fieldLabel : 'Name',
|
||||
msgTarget : 'side',
|
||||
allowBlank : false,
|
||||
maxLength : 255
|
||||
}, {
|
||||
xtype : 'datefield',
|
||||
anchor : '100%',
|
||||
id : 'FtimeE',
|
||||
name : 'TimeD',
|
||||
fieldLabel : 'Date',
|
||||
msgTarget : 'side',
|
||||
allowBlank : false,
|
||||
format : 'Y-m-d',
|
||||
altformat: 'Y-m-d H:i',
|
||||
maxLength : 255
|
||||
}, {
|
||||
xtype : 'textfield',
|
||||
anchor : '100%',
|
||||
id : 'FquestionE',
|
||||
name : 'Question',
|
||||
fieldLabel : 'Question',
|
||||
msgTarget : 'side',
|
||||
allowBlank : false,
|
||||
maxLength : 255
|
||||
}
|
||||
],
|
||||
dockedItems : [{
|
||||
xtype : 'toolbar',
|
||||
dock : 'bottom',
|
||||
items : [{
|
||||
xtype : 'tbfill'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'cancel',
|
||||
iconCls : 'icon-reset',
|
||||
text : 'Cancel'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'save',
|
||||
formBind : true,
|
||||
iconCls : 'icon-save',
|
||||
text : 'Update'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
me.callParent(arguments);
|
||||
}
|
||||
});
|
@@ -0,0 +1,69 @@
|
||||
Ext.define('ExtMVC.view.contact.Filtro', {
|
||||
extend : 'Ext.window.Window',
|
||||
alias : 'widget.contatofiltro',
|
||||
autoShow : true,
|
||||
height : 168,
|
||||
width : 398,
|
||||
layout : {
|
||||
type : 'fit'
|
||||
},
|
||||
iconCls : 'icon-user',
|
||||
title : 'Filtrar/Buscar Contatos',
|
||||
initComponent : function () {
|
||||
var me = this;
|
||||
|
||||
Ext.applyIf(me, {
|
||||
items : [{
|
||||
xtype : 'form',
|
||||
style : 'background-color: #fff;',
|
||||
bodyPadding : 10,
|
||||
items : [{
|
||||
xtype : 'hiddenfield',
|
||||
anchor : '100%',
|
||||
name : 'ID',
|
||||
fieldLabel : 'Label'
|
||||
}, {
|
||||
xtype : 'textfield',
|
||||
anchor : '100%',
|
||||
id : 'Fname',
|
||||
name : 'Name',
|
||||
fieldLabel : 'Name',
|
||||
msgTarget : 'side',
|
||||
allowBlank : false,
|
||||
maxLength : 255
|
||||
}, {
|
||||
xtype : 'datefield',
|
||||
anchor : '100%',
|
||||
id : 'Ftime',
|
||||
name : 'TimeD',
|
||||
fieldLabel : 'Time',
|
||||
msgTarget : 'side',
|
||||
allowBlank : false,
|
||||
format : 'd-m-Y',
|
||||
maxLength : 255
|
||||
}
|
||||
],
|
||||
dockedItems : [{
|
||||
xtype : 'toolbar',
|
||||
dock : 'bottom',
|
||||
items : [{
|
||||
xtype : 'tbfill'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'reset',
|
||||
text : 'Reset Filter'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'filtrar_busca',
|
||||
formBind : true,
|
||||
text : 'Filter'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
me.callParent(arguments);
|
||||
}
|
||||
});
|
@@ -0,0 +1,95 @@
|
||||
Ext.apply(Ext.form.field.VTypes, {
|
||||
daterange : function (val, field) {
|
||||
var date = field.parseDate(val);
|
||||
if (!date) {
|
||||
return false;
|
||||
}
|
||||
if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) {
|
||||
var start = field.up('form').down('#' + field.startDateField);
|
||||
start.setMaxValue(date);
|
||||
start.validate();
|
||||
this.dateRangeMax = date;
|
||||
} else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
|
||||
var end = field.up('form').down('#' + field.endDateField);
|
||||
end.setMinValue(date);
|
||||
end.validate();
|
||||
this.dateRangeMin = date;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
daterangeText : 'Start date must be before end date'
|
||||
});
|
||||
|
||||
Ext.tip.QuickTipManager.init();
|
||||
Ext.define('ExtMVC.view.contact.Filtrod', {
|
||||
extend : 'Ext.form.Panel',
|
||||
alias : 'widget.contatofiltrod',
|
||||
autoShow : true,
|
||||
renderTo : 'dr',
|
||||
height : 160,
|
||||
width : 400,
|
||||
padding : 10,
|
||||
layout : {
|
||||
type : 'fit'
|
||||
},
|
||||
iconCls : 'icon-user',
|
||||
title : '<h1>Filtering Date Range</h1>',
|
||||
|
||||
initComponent : function () {
|
||||
var me = this;
|
||||
Ext.applyIf(me, {
|
||||
items : [{
|
||||
xtype : 'form',
|
||||
style : 'background-color: #fff;',
|
||||
bodyPadding : 10,
|
||||
items : [{
|
||||
xtype : 'datefield',
|
||||
fieldLabel : 'Start Date',
|
||||
name : 'startdt',
|
||||
itemId : 'startdt',
|
||||
format : 'd-m-Y',
|
||||
id : 'startdt',
|
||||
vtype : 'daterange',
|
||||
endDateField : 'enddt' // id of the end date field
|
||||
}, {
|
||||
xtype : 'datefield',
|
||||
fieldLabel : 'End Date',
|
||||
name : 'enddt',
|
||||
itemId : 'enddt',
|
||||
format : 'd-m-Y',
|
||||
id : 'enddt',
|
||||
vtype : 'daterange',
|
||||
startDateField : 'startdt' // id of the start date field
|
||||
}
|
||||
],
|
||||
dockedItems : [{
|
||||
xtype : 'toolbar',
|
||||
dock : 'bottom',
|
||||
items : [{
|
||||
xtype : 'tbfill'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'resetd',
|
||||
iconCls : 'icon-default',
|
||||
text : 'Reset Filter'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'filtrar_buscad',
|
||||
formBind : true,
|
||||
iconCls : 'icon-filter',
|
||||
text : 'Filter'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'deleterange',
|
||||
iconCls : 'icon-delete',
|
||||
text : 'Delete Date Range'
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
me.callParent(arguments);
|
||||
}
|
||||
});
|
@@ -0,0 +1,117 @@
|
||||
Ext.define('RemoteCountrySearch', {
|
||||
extend : 'Ext.form.ComboBox',
|
||||
alias : 'widget.remoteCountrySearch',
|
||||
queryMode : 'remote',
|
||||
displayField : 'Name',
|
||||
valueField : 'ID',
|
||||
forceSelection : true,
|
||||
id : 'countryBox',
|
||||
style : 'font-size: medium; color: blue;',
|
||||
fieldStyle : 'font-size: medium; color: red; heigth: 50px;',
|
||||
labelWidth : 80,
|
||||
fieldLabel : 'Select a Name',
|
||||
size : 50,
|
||||
maxLength : 50,
|
||||
allowBlank : true,
|
||||
name : 'remoteCountry',
|
||||
store : 'Contacts',
|
||||
minChars : 2,
|
||||
hideTrigger : true,
|
||||
triggerAction : 'All',
|
||||
typeAhead : false,
|
||||
listeners : {
|
||||
'beforequery' : function (queryEvent, options) {
|
||||
this.store.loadPage(1);
|
||||
this.store.remoteFilter = false;
|
||||
this.store.clearFilter();
|
||||
this.store.remoteFilter = true;
|
||||
this.store.getProxy().extraParams = {
|
||||
where : 'Name like :("' + queryEvent.query + '%"):'
|
||||
};
|
||||
this.store.load();
|
||||
},'keyup': function() {/*TODO*/}
|
||||
}
|
||||
});
|
||||
|
||||
Ext.define('ExtMVC.view.contact.Grid', {
|
||||
extend : 'Ext.grid.Panel',
|
||||
alias : 'widget.contactgrid',
|
||||
renderTo : 'warleyalex',
|
||||
padding : 10,
|
||||
id : 'mygrid',
|
||||
iconCls : 'icon-grid',
|
||||
title : 'Using mORMot with ExtJS >> by warleyalex',
|
||||
store : 'Contacts',
|
||||
initComponent : function () {
|
||||
var me = this;
|
||||
|
||||
Ext.applyIf(me, {
|
||||
columns : [{
|
||||
xtype : 'gridcolumn',
|
||||
text : "id",
|
||||
width : 10,
|
||||
dataIndex : 'ID',
|
||||
sortable : true,
|
||||
hidden : true
|
||||
}, {
|
||||
xtype : 'gridcolumn',
|
||||
width : 50,
|
||||
dataIndex : 'Name',
|
||||
flex : 1,
|
||||
text : 'Name'
|
||||
}, {
|
||||
xtype : 'gridcolumn',
|
||||
width : 10,
|
||||
dataIndex : 'TimeD',
|
||||
flex : 1,
|
||||
text : 'Date'
|
||||
}, {
|
||||
xtype : 'gridcolumn',
|
||||
width : 50,
|
||||
dataIndex : 'Question',
|
||||
flex : 1,
|
||||
text : 'Question'
|
||||
}
|
||||
],
|
||||
viewConfig : {
|
||||
emptyText : 'no records found'
|
||||
},
|
||||
dockedItems : [{
|
||||
xtype : 'toolbar',
|
||||
dock : 'top',
|
||||
items : [{
|
||||
xtype : 'button',
|
||||
action : 'add',
|
||||
iconCls : 'icon-save',
|
||||
text : 'Add'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'delete',
|
||||
iconCls : 'icon-delete',
|
||||
text : 'Delete'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'filtrar',
|
||||
iconCls : 'icon-search',
|
||||
text : 'Full Search'
|
||||
}, {
|
||||
xtype : 'button',
|
||||
action : 'filtrar_name',
|
||||
text : 'Date Range'
|
||||
}, {
|
||||
xtype : 'remoteCountrySearch'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
xtype : 'pagingtoolbar',
|
||||
dock : 'bottom',
|
||||
width : 1004,
|
||||
displayInfo : true,
|
||||
emptyMsg : 'No contact to display',
|
||||
store : 'Contacts'
|
||||
}
|
||||
]
|
||||
});
|
||||
me.callParent(arguments);
|
||||
}
|
||||
});
|
@@ -0,0 +1,52 @@
|
||||
.x-fit-item {
|
||||
margin: 0pt; font-size: 40px;
|
||||
font-weight: bold;
|
||||
background-image: url(../images/error.png) !important;
|
||||
}
|
||||
|
||||
.icon-search {
|
||||
background-image: url(../images/search.gif) !important;
|
||||
}
|
||||
|
||||
.icon-default {
|
||||
background-image: url(../images/default.gif) !important;
|
||||
}
|
||||
|
||||
.icon-filter {
|
||||
background-image: url(../images/filter.gif) !important;
|
||||
}
|
||||
|
||||
.icon-user {
|
||||
background-image: url(../images/user.png) !important;
|
||||
}
|
||||
|
||||
.icon-user-add {
|
||||
background-image: url(../images/user_add.gif) !important;
|
||||
}
|
||||
|
||||
.icon-save {
|
||||
background-image: url(../images/save.gif) !important;
|
||||
}
|
||||
|
||||
.icon-reset {
|
||||
background-image: url(../images/stop.png) !important;
|
||||
}
|
||||
|
||||
.icon-grid {
|
||||
background-image: url(../images/grid.png) !important;
|
||||
}
|
||||
|
||||
.icon-add {
|
||||
background-image: url(../images/add.png) !important;
|
||||
}
|
||||
|
||||
.icon-delete {
|
||||
background-image: url(../images/delete.png) !important;
|
||||
}
|
||||
.x-panel-header-default {
|
||||
background-color: #FFFD3E1F1;
|
||||
}
|
||||
.x-panel-header-text-default {
|
||||
color: FFFD3E1F1;
|
||||
font-family: tahoma,arial,verdana,sans-serif;
|
||||
}
|
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 715 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 643 B |
After Width: | Height: | Size: 513 B |
After Width: | Height: | Size: 1014 B |
After Width: | Height: | Size: 152 B |
After Width: | Height: | Size: 700 B |
After Width: | Height: | Size: 741 B |
After Width: | Height: | Size: 1001 B |