jurisv / extdirect.examples Goto Github PK
View Code? Open in Web Editor NEWExamples of Ext.Direct usage with node.js
Examples of Ext.Direct usage with node.js
Because if I (anyone) clone(s) it or fork(s) it and the resulting directory or repo lives at top level with other repos it is too generic "code-examples".
Hello Juris,
Sorry if this is not the right place to put this, but i could not find another spot.
Thank you for the examples. I got it up and running yesterday, but I have a question / suggestion.
Wouldn't it be better to use uuid's instead of auto increment for the id?
For the MySql example i changed the code in DXToDoItem.js so it creates a uuid using the node-uuid lib and use this uuid (params['id']) for the second query.
Next to that, change MySql column structure to match uuid (e.g. char(36)). Clientside id becomes string instead of int. Works perfect for me.
var table = 'todoitem';
var db = global.App.database;
var uuid = require('node-uuid');
var DXTodoItem = {
create: function(params, callback){
var conn = db.connect();
//delete params['id'];
params['id'] = uuid.v4();
conn.query('INSERT INTO ' + table + ' SET ?', params, function(err, result) {
if (err) throw err;
conn.query('SELECT * FROM ' + table + ' WHERE id = ?', params['id'], function(err, rows, fields) {
db.disconnect(conn); //release connection
callback({
success: true,
data: rows[0]
});
});
});
},
Thanks again!
I am recognizing that in directory direct
multiple classes like DXTodoItem.js
could inherit a lot of common code from a generic class. I see the need clearly for an example with MongoDB I am working on.
Do you, does anyone, have a suggestion, from experience, with Node.js, in this context, which kind of inheritance to use?
Hi! I'm brand new to sencha/extjs and have difficulties following the instructions...
I've done the following (on win 8.1):
sencha generate app DemoExtJs ..\DemoExtJs
within the ext-4.2.1.883
folderext
folder in extdirect.examples\client\DemoExtJs
with the generated oneRunning sencha app refresh
in extdirect.examples\client\DemoExtJs
results in:
Sencha Cmd v5.1.1.39 [INF] Processing Build Descriptor : default [ERR] [ERR] BUILD FAILED [ERR] com.sencha.exceptions.ExNotFound: Required property file [path]\extdirect.examples\client\DemoExtJs\.sencha\app\development.defaults.properties does not exist [ERR] [ERR] Total time: 0 seconds [ERR] The following error occurred while executing this line: [path]\bin\Sencha\Cmd\5.1.1.39\plugins\ext\4.2\plugin.xml:394: The following error occurred while executing this line: [path]\extdirect.examples\client\DemoExtJs\.sencha\app\init-impl.xml:62: com.sencha.exceptions.ExNotFound: Required property file [path]\extdirect.examples\client\DemoExtJs\.sencha\app\development.defaults.properties does not exist
Should I use another combo of framework and sencha cmd?
Or have I simply misread the instructions? (they are a bit vague for someone not familiar with extjs)
Thanks
Using Architect example. Watching in mongo with
use extdirectnode
db.tasks.find()
Every time bringing up Add Task button adds an extraneous task (as you can see in Mongo). Further all those tasks have a Mongo generated _id ObjectId as well as an id of 0. Which one could be willing to overlook if it weren't the issue that on load of the gridpanel one sees only a single (the most recent?) of those tasks, as if all of them having id 0 prevents the additional tasks from showing,
We seem not to find an easy way to open this as a project in Sencha Architect 3 so far.
Any advice or additional file needed?
Got this working with Sencha Cmd. But now a colleague asks questions so I thought "let's open this with Sencha Architect 3" so we can "see" how the Store is configured, so she can do the same (using Ext.Direct for store) in her from scratch project in Sencha Architect 3.
To set something in a session, or to read from it I need to get to req.session, means need to get to req.
How to do that inside e.g. DXFormTest.js or DXTodoItem.js?
Please share option "classPath" on "classPath" and "classUrl", does not always correspond to the physical location of the folder path RL. For example I have it so: "classUrl": "/ direct",
"classPath": "/ app / direct"
You probably know this kind of situation, so I'll keep it short: Apparently at time of autoLoad the DirectAPI isn't available yet, so it fails (nasty stuff in console log saying can't do that API), and the spinning Loading indicator prevents anything from being done in UI. After I switched off (got rid of) autoLoad for Tasks store there was no more nasties in console log, no more spinning Loading indicator, and I was able to click Add Task and add a task, which I then saw in MongoDB. Obviously though didn't load existing data on startup, but you probably know where you want to trigger that (what event).
I think there isn't a WHERE in the MySQL implementation, which means it cannot support filtering. Did I think correctly?
I'd like to implement complete CRUD support for MongoDB, and I am looking at your MySQL as an example.
Is that the last item missing for complete CRUD according to Ext.Direct?
As side thought: Would that same code that does filtering also take care of read finding by id, if that is in use anywhere in Ext JS? I don't know whether that is a feature of read use by Ext JS and Ext.Direct, I am just thinking it would be the same kind of WHERE.
Same as last time, if you lead for MySQL, I will follow for MongoDB. This time I should be faster because this is a smaller step and we are actually using it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.