Results 1 to 2 of 2

Thread: Ext.Direct with ExtJS4

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    54
    Vote Rating
    0
      0  

    Default Ext.Direct with ExtJS4

    I'm trying to create my server-side code for using Ext.Direct with ExtJS 4 and it seems like, to me, that RPC methods are static only?

    I just mean, if I have a model "user" and wanted to add "user.getPermissions()" to interface with my server side method $user->getPermissions() is it possible that I could automatically pass $user->primaryKey?

    In what I've managed to accomplish "getPermissions" becomes a class method (static method) of "user" instead of an object method that can include user model information.

    So, I'm able to do something like this:

    Code:
    var Permissions = user.getPermissions( 100 );  // 100 is user id
    What I'd like to do instead, is this:

    Code:
    var user = Ext.ModelMgr.getModel('user');
    user.load(100, {
    	success: function(user){
    		user.permissions = user.getPermissions();
    		// where user.data.user_id is included automatically
    		// in the RPC
    	}
    });
    Please let me know if this is possible.

  2. #2
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,008
    Vote Rating
    936
      0  

    Default

    In the next release you'll be able to do:

    Code:
    Ext.define('User', {
        extend: 'Ext.data.Model',
        getPermissions: function(){
            // make direct call here
        }
    });
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Similar Threads

  1. MVC in EXTJS4, folder structure?
    By koke in forum Ext: Discussion
    Replies: 6
    Last Post: 20 Nov 2011, 1:20 AM
  2. ExtJs3 and ExtJs4 in One App
    By Darren Martz in forum Ext: Discussion
    Replies: 3
    Last Post: 7 Apr 2011, 8:48 AM
  3. Calendar in Extjs4
    By stratboogie in forum Ext: Discussion
    Replies: 2
    Last Post: 6 Apr 2011, 3:25 AM
  4. ExtJs3 to ExtJs4 Migration
    By same66 in forum Ext: Discussion
    Replies: 4
    Last Post: 1 Mar 2011, 5:18 PM
  5. Ext.Direct Changes for ExtJS4?
    By Dumas in forum Ext.Direct
    Replies: 0
    Last Post: 16 Feb 2011, 7:31 AM

Posting Permissions

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