1. #1
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    54
    Vote Rating
    0
    c2c-guinness is on a distinguished road

      0  

    Default Ext.Direct with ExtJS4

    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 - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,103
    Vote Rating
    500
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      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
        }
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

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

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar