Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 06091aa062
Fetching contributors…

Cannot retrieve contributors at this time

file 80 lines (70 sloc) 1.71 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
Author is mycoding
Account page on Sencha forum http://www.sencha.com/forum/member.php?135053-Mycoding
email:mycodingqt@gmail.com
icq:395712335
Skype:MycodingExtJS

ExtNodeJS - framework for NodeJS on base of Ext Core and several classes of ExtJS.

It is in developing.
At the moment it is possible to do Templating of pages, sending mails and some basic tricks.
I will try to do some samples.

Samples with explanation are here (in Russian)
http://javascript.ru/blog/mycoding/Ext-Core-dlya-NodeJS

**Templating**

var Ext = require('./extnodejs.js').Ext;
Ext.init(this);

var data = {
    name: 'Jack Slocum',
    kids: [{
        name: 'Sara Grace',
        age:3
    },{
        name: 'Zachary',
        age:2
    },{
        name: 'John James',
        age:0
    }]
};

var tpl = new Ext.XTemplate(
    '<p>Name: {name}</p>',
    '<p>Kids: ',
    '<tpl for="kids">',
        '<tpl if="age > 1">',
            '<p>{name}</p>',
            '<p>Dad: {parent.name}</p>',
        '</tpl>',
    '</tpl></p>'
);

var html = tpl.applyTemplate(data);
console.log(html);

**Sending Email**
var Ext = require('./extnodejs.js').Ext;
Ext.init(this);
new Ext.Mail({
to: "mycoding@mail.ru",
from: "me@example.com",
subject: "Knock knock...",
body: "Who's there?",
success:function(){
console.log('Success');
},
failure:function(err){
console.log('Error:'+err);
}
}).send();

**Sending responce to url**
//Test
var Ext = require('./extnodejs.js').Ext;
Ext.init(this);
new Ext.Ajax({
url: 'http://moc-081.ru/json.php',
method:'GET',
params: { foo: 'bar' },
success: function(data){
var obj = Ext.decode(data);
console.log(obj);
},
failure: function(){
console.log('failure');
}
}).request();
Something went wrong with that request. Please try again.