Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: Alternative Ext Direct PHP Implementation

  1. #21
    Sencha Premium Member
    Join Date
    Jul 2007
    Haan, Germany


    Hi Tommy,

    something is missing in your implementation, and it belongs to file upload.
    Please have a look to our TYPO3 implementation i posted some minutes ago (when it is reviewed - why are new posts here are reviewed?)

    Just in short:

    in Router:
    $data->data = array($_POST, $_FILES);
    should read
    $data->data = array($_POST + $_FILES);

    and for the response of file uploads you will need something like
    $response = json_encode($response);
    $response = preg_replace('/"/', '\\"', $response);
    $response = array(
    	'<html><body><textarea>' .
    	$response .

  2. #22
    Sencha User
    Join Date
    Jun 2009
    Uberlndia, MG, Brazil

    Lightbulb Yet another approach

    Hi, guys,

    Would you mind taking a look at my own approach to the Ext.Direct / PHP integration?
    Last edited by j.bruni; 25 Mar 2010 at 3:02 AM. Reason: Created another thread for the subject

  3. #23

    Question Real Basic Example needed

    I'm relatively new to Extjs, but am getting on OK, until I hit Direct. I'm writting an app with a lot of server-side code, so I thought I'd do it right from the beginning with this interface.

    Here's the code I've got in a basic test page, stripped to the minimum. I've used the download from this thread with no other changes except to move the sessions_start to my parent page, rather than within the api.php page, as I'll need it in the parent for my real application:

        <title>Ext.Direct Test</title>
     <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"/>
     <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
     <script type="text/javascript" src="ext/ext-all-debug.js"></script>
     <script type="text/javascript" src="api.php"></script>
     <script type="text/javascript">
            Ext.onReady(function() {
       Ext.BLANK_IMAGE_URL = 'images/s.gif';
       // Test the direct setup
       var rv ='hello, world'); 
                alert ("Direct response: " + rv);
    I'm getting the error:" is null or not an object" on line 14

    Can anyone point me in the right direction please?


  4. #24


    My question may be silly.
    Please help me out of this issue.
    I am using a form with direct api and trying to insert records in to the db. But form values are not submitting to the server side.
    My Code:
    formadd= new Ext.form.FormPanel({
    // configs for FormPanel
    title: Add record,
    border: false,
    padding: 10,
    text: 'Submit',
    handler: function(){
    params: {
    foo: 'bar',
    uid: 34
    defaultType: textfield,
    items: [{
    fieldLabel: 'Name',
    name: 'name'
    fieldLabel: 'Email',
    msgTarget: 'side',
    name: 'logo_url'
    api: {
    // The server-side method to call for load() requests
    // The server-side must mark the submit handler as a formHandler
    // specify the order for the passed params
    paramOrder: ['uid', 'foo']
    Please help me soonnnnnnnnnnnn!!!!!!!

  5. #25


    Please help me from this issue ANYONE. SOON

  6. #26


    Try the following amendment:

    api: {
    // The server-side method to call for load() requests
    // The server-side must mark the submit handler as a formHandler
    This assumes you've included the ExtDirect API with a line something like the following:

    <script type="text/javascript" src="classes/Vendor.php?javascript"></script>
    Hope that helps,

  7. #27


    Oops. Just realised that I thought this was the thread at

    The answer I've given only applies (I'm sure) if you're using the PHP classes mentioned in that thread (which I recommend, as they are re-vamped version of the classes in this thread).


  8. #28

    Default Please help

    Its shows the following error Error: Ext.php is undefined

  9. #29



    I am using codeigniter for server side and implementing Direct on a PHP server stack.

    Listed all the db table records in a grid using endpoint Vendor. Using like this = new{

    endpoint: Vendor,
    // autoLoad: False,
    fields: [
    { name: 'id' },
    { name: 'name', type: 'string' }

  10. #30

    Default = Ext.extend(, {
    constructor: function(config) {
    config = Ext.apply({
    root: 'records',
    autoLoad: true,
    autoSave: true,
    remoteSort: true,
    batch: false,
    writer: new{
    encode: false,
    writeAllFields: true
    }, config);

    if (config.endpoint && !config.directFn) {
    config.api = {
    read :,
    create :,
    update :,
    destroy : config.endpoint.destroy
    }, config);

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts