View Full Version : [3.0 RC1] DirectStore

17 Apr 2009, 4:06 AM
any working DirectStore example?

me don't get it,
help appreciated (if using svn version plz mention)
backend and Provider is not needed / not in detail, those are working fine
(used Ext.Direct Example and added a getData method which gives some Array of Objects Result)

kind regards

my try:


18 Apr 2009, 4:40 AM
for sure DirectProxy seems incomplete.

not using the directFn on store config,
instead using api.load, causes DirectProxy.doRequest to add the params ({xaction:'load'}) as a first argument,
so it mismatches the Provider methods arguments and with it the arguments callback position

as a unpretty workaround for the above code it should do setting the Providers method arguments len to 1 and removing the root property

if DirectProxy working as intended, it may look something like this: (for the above code)
[CODE][ ... ]
var store = new Ext.data.DirectStore({
autoLoad : true,

19 May 2009, 2:51 PM
I am trying the directFn and it is adding 'xaction' => 'load' to the 'data' passed.


How do I get it to load without that, and pass parameters to the function?

when I added baseParams, paramsNames it works,
but that locks it down the the baseParams.

Ext.ns('Ext.BENINT'); Ext.BENINT.APIDesc = {"url":"router\/","type":"remoting","actions":{"ExtDirect_Tickets":[{"name":"get","len":2},{"name":"add","len":2,"formHandler":true},{"name":"save","len":2,"formHandler":true},{"name":"delete","len":2,"formHandler":true},{"name":"list","len":1,"serverMethod":"example"},{"name":"doEcho","len":1},{"name":"multiply","len":1}]},"namespace":"Ext.BENINT"};

var store = new Ext.data.DirectStore({
api: {
load: Ext.BENINT.ExtDirect_Tickets.get,
create: Ext.BENINT.ExtDirect_Tickets.add,
save: Ext.BENINT.ExtDirect_Tickets.save,
destroy: Ext.BENINT.ExtDirect_Tickets.delete
paramOrder: ['sort','dir','start','limit'],
autoLoad : true,
root: 'list',
paramsNames: {
start : "start", // The parameter name which specifies the start row
limit : "limit", // The parameter name which specifies number of rows to return
sort : "sort", // The parameter name which specifies the column to sort on
dir : "dir" // The parameter name which specifies the sort direction
remoteSort: true,
baseParams: {
start : "1",
limit : "10",
sort : "id",
dir : "ASC"
idProperty: 'id',
fields: [
name: 'id',
type: 'int'
listeners : {
load : function()
console.info('load', this, arguments)
loadexception : function()
console.warn('loadexception', this, arguments)
update : function()
Commit all Records with outstanding changes.
To handle updates for changes, subscribe to the Store's update event,
and perform updating when the third parameter is Ext.data.Record.COMMIT.
console.warn('loadexception', this, arguments)
scope : this

// create the Grid
var grid = new Ext.grid.EditorGridPanel({
store: store,
colModel: new Ext.grid.ColumnModel({
columns: [
{id:'ticket_id', header: "ID", width: 30, dataIndex: 'id'},
{id:'ticket_value', header: "Value", dataIndex: 'value'}
/*{header: "Change", renderer: change, dataIndex: 'change'}*/
defaults: {
sortable: true,
width: 75
autoExpandColumn: 'ticket_value', // match the id specified in the column model
/*title:'Array Grid',*/
tbar: [{
text: 'Add Record',
handler : function(){
Need to find how to add to db
var defaultData = {
id: '-',
value: '1'
var recId = 3; // provide unique id
var p = new store.recordType(defaultData, recId); // create new record
store.insert(0, p); // add new record to the store
grid.startEditing(0, 0);

var p = new Ext.Panel({
title : 'Remote Call Grid',
width : 600,
height : 300,
layout : 'fit',
items : [
bbar : [