-
Notifications
You must be signed in to change notification settings - Fork 1
Wakanda REST API with ExtJS 4
To ease the use of the Wakanda REST API with ExtJS 4, the Revolunet developer team have override several ExtJS objects:
- proxy: Ext.data.proxy.Wakanda.js
- reader: Ext.data.reader.Wakanda.js
- writer: Ext.data.writer.Wakanda.js
- model: Ext.data.WakandaModel.js
This allows to create Wakanda models in ExtJS 4 and use data of a Wakanda server.
Let's say we have created data sources on Wakanda server, "Company" and "Employee", like:

When an Ext.data.WakandaModel is declared all the model description is fetched from the server and creates an ExtJS model bound to the related Wakanda data source. If there is a Wakanda data source named "Employee" on the server we can define an "Employee" model in ExtJS 4, like:
Ext.define('Employee', {
extend: 'Ext.data.WakandaModel'
});
And use it in store:
var store = Ext.create('Ext.data.Store', {
remoteSort: true,
model: 'Employee'
});
store.load();
Or load it directly:
var Employee = Ext.ModelManager.getModel('Employee');
Employee.load(3083, {
success: function(employee) {
console.log(employee.get('lastName')); // Smith
}
});
-
Open the example project in Wakanda Studio
The project is located here: /example/example/example.waProject -
Go to WebFolder directory and run examples
Model (model.html)
This example shows how to use an ExtJS model with a Wakanda data source.
The use of the Ext.data.WakandaModel allows to create, load, update and destroy a Wakanda entity on server.

Store (store.html)
This example shows how to use an ExtJS store with a Wakanda data source.
The store proxy use the Wakanda REST API to sort data and to do paging as well.

Filter (filter.html)
This example shows how to create an ExtJS "infinite scroll" grid based on Wakanda data source.
The store proxy allows data filters.

RPC (rpc.html)
This example shows how to request a Wakanda server RPC method to animate an ExtJS chart.
