PDA

View Full Version : Ext DirectPack and DirectStore



nik206
20 Aug 2009, 8:38 AM
Hi all!!! If it is not difficult maybe someone of developers Ext or users post here some simple example how to use ExtDirect (Pack) and DirectStore
My problem is:
I use default method calling methods on server side with php language and everything is ok.
But i try to implement a DirectStore layer between server side and My form and get errors.
This error getting up when i try to load data from serverside function.
There is my example:

Ext.ss.APIDesc.enableBuffer = 100;
Ext.Direct.addProvider(Ext.ss.APIDesc);

Ext.QuickTips.init();
var temp = new Ext.data.DirectStore({
autoLoad: true,
paramsOrder: '',
directFn: Ext.ss.login.LoadDefaultUser,
root: 'username',
fields:[{name:'username'}]
});

and on server side function is realized like Direct (Pack) is needed:

class login{
/**
* @formHandler
* @remotable
*/
function LoadDefaultUser(){
$response['success'] = true;
$responce['username'] = "user12345";
return $responce;
}
}

If it is not difficult to answer to beginning ext users pleas post some working example with comments.
PS:
Sorry for my English))))

fausastu
21 Aug 2009, 2:22 PM
class login{
/**
* @formHandler
* @remotable
*/
function LoadDefaultUser(){

$response['success'] = true;
/* Do you had chaged this */
$responce['username'] = "user12345";
/* for this ? */
$response['username'] = "user12345";
/* note you're using $response and $responce vars in your code) */
return $responce;
}
}

nik206
21 Aug 2009, 10:43 PM
Yes, thank you. but it doesn't resolve my problem.
For debugging i use firebug and error that it shows is:
form.getAttribute is not a function
var isUpload = String(form.g...oLowerCase() == 'multipart/form-data',
i think that i didn't set some attribute to DataStore. if so maybe someone knows what?