1. #1
    Sencha Premium Member zonereseau's Avatar
    Join Date
    Jan 2008
    Location
    Sherbrooke, QC
    Posts
    35
    Vote Rating
    5
    zonereseau is on a distinguished road

      0  

    Default Unanswered: Ext Direct in Form API problem

    Unanswered: Ext Direct in Form API problem


    Hi,

    Am I missing something or the Ext direct API is not implemented in the form yet? I developped a complete ExtJS 4.1 application using Ext direct API for all my Form and Grid using CRUD in the grid and Load and Submit in the form.

    For example :
    Code:
    Ext.create('Ext.form.Panel', {
        api: {
            submit:Progik.direct['core.authentication'].login
        },
        paramsAsHash: true
        ....
    });
    This doesn't seems to work into sencha touch. Since I've create a formHandler for the function I want to call how can I call this function directly?

    I've tried to do this without any luck because the function configureFormRequest doesn't exist:
    Code:
    Progik.direct['core.authentication'].login(myform, function(response) {
    }, myscope);
    The only other way I'm currently thinking about is to use Ext.Ajax to call my Ext Direct Router with the correct parametters... Is there any other ways?

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,117
    Vote Rating
    453
    Answers
    3160
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Is this question for Ext JS 4? This was posted in Sencha Touch 2 forum.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member zonereseau's Avatar
    Join Date
    Jan 2008
    Location
    Sherbrooke, QC
    Posts
    35
    Vote Rating
    5
    zonereseau is on a distinguished road

      0  

    Default


    This is for sencha touch 2.1, I'm just saying that it work in ExtJS but seems not to be implemented yet in sencha touch and looking for a solution to use it.

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Location
    Russia
    Posts
    39
    Vote Rating
    3
    Answers
    1
    another_i is on a distinguished road

      0  

    Default


    The same question is interesting for me too. There are any comments about this problem from sencha touch developers?

  5. #5
    Sencha Premium Member zonereseau's Avatar
    Join Date
    Jan 2008
    Location
    Sherbrooke, QC
    Posts
    35
    Vote Rating
    5
    zonereseau is on a distinguished road

      0  

    Default


    I manage to create my own little function to submit my form with ExtDirect in sencha touch:

    Code:
    var directRouterUrl		= "/direct-router";
    
    var directSubmit = function(config) {
    		
    	var params 			= config.params || {};
    	var scope			= config.scope || this;	
    	
    	params.extTID 		= 1;
    	params.extAction 	= config.action;
    	params.extMethod 	= config.method;
    	params.extType 		= 'rpc';
    	params.extUpload 	= false;
    	
    	Ext.Ajax.request({
    		url:directRouterUrl,
    		params:params,
    		method:'POST',
    		callback:function(options, success, response) {
    			if(success) {
    				if(config.success) {
    					var response = Ext.decode(response.responseText);				
    					Ext.Function.bind(config.success, scope)(response.result, options);
    				}
    			}			
    			else {
    				if(config.failure) {
    					Ext.Function.bind(config.failure, scope)(response, options);
    				}
    			} 
    		}
    	});		
    };
    
    // To use it just do this
    directSubmit({
      action:'contact',
      method:'submit',
      params:myform.getValues(),
      success:function(result, options) {
      },
      failure:function(result, options) {
      }
    });

  6. #6
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    311
    Vote Rating
    2
    Answers
    2
    stewardsencha is on a distinguished road

      0  

    Default


    I was under the distinct impression that Touch and ExtJS shared the same data package.