Results 1 to 4 of 4

Thread: Direct MVC Architecture Sencha Designer

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    10
    Vote Rating
    0
      0  

    Default Direct MVC Architecture Sencha Designer

    Hello!

    May I ask you some questions.
    My project had been written a long time ago in PHP, MySql ? JS.
    Now the time has come to upgrade it.
    I like your framework extjs4 c Sencha Designer 2 very much.
    First of all I made out an example of "Mapping a Grid to a MySQL table using Direct and PHP"
    It works well because it uses Ext.onReady
    I tried to realize it in Sencha Designer 2 using MVC Architecture.
    It doesn't work.

    1. In Sencha Designer for store api attribute in the Component Config inspector I change value on
    {
    create: QueryDatabase.createRecord,
    read: QueryDatabase.getResults,
    update: QueryDatabase.updateRecords,
    destroy: QueryDatabase.destroyRecord
    }


    Than save and ooking through the code I see that api has the value as string

    proxy: {
    type: 'direct',
    api: '{
    create: QueryDatabase.createRecord,
    read: QueryDatabase.getResults,
    update: QueryDatabase.updateRecords,
    destroy: QueryDatabase.destroyRecord
    }'
    }

    Firebug gives out an error

    fn is undefined

    method = fn.directCfg.method; ext-all-debug.js (?????? 52629)


    2. If I remove the quotes

    api: {
    create: QueryDatabase.createRecord,
    read: QueryDatabase.getResults,
    update: QueryDatabase.updateRecords,
    destroy: QueryDatabase.destroyRecord
    }


    Firebug gives out an error

    QueryDatabase is not defined

    syncRequire: function() { ext-all-debug.js (?????? 4637)


    Help!

    3.Most os developers use Mysql and PHP

    Please, update sample "Mapping a Grid to a MySQL table using Direct and PHP"
    for MVC Architecture

    Thank you beforehand.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
      0  

    Default

    Hi,

    Currently you cannot use references inside object.

    However you can use string values as follows

    Code:
    api:{    create  :'/controller/new',    
    read    :'/controller/load',    
    update  :'/controller/update',    
    destroy :'/controller/destroy_action'
    }
    
    Bharat Nagwani
    Sencha Designer Development Team

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    462
    Vote Rating
    39
      0  

    Default

    Currently? Has that changed?



    I am trying to populate a form panel.
    I have added a direct proxy to the model.
    In a controller override I call this.getModel('VMaster').load(6);

    I fail at
    Code:
    if (operation=='read')
    {
      method=fn.directCfg.method
    ...
    ReferenceError: directCfg is not defined

    The value of fn is "Ext.app.VMaster.view" Just the string.

    The api is set up as follows:
    {
    create: 'Ext.app.VMaster.create',
    read: 'Ext.app.VMaster.view',
    update: 'Ext.app.VMaster.update',
    destroy:'Ext.app.VMaster.destroy'
    }

    If I leave the quotes off, fn is undefined.

    How can I enter a directCfg in SA?
    Thanks

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
      0  

    Default

    Hi, That post that you are referring is a bit old. Direct configuration now support references for api

    so you can use this
    Code:
    {
    create: QueryDatabase.createRecord,
    read: QueryDatabase.getResults,
    update: QueryDatabase.updateRecords,
    destroy: QueryDatabase.destroyRecord
    }
    Bharat Nagwani
    Sencha Designer Development Team

Posting Permissions

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