Results 1 to 10 of 10

Thread: ExtJs DataProxy overrider

  1. #1
    Sencha Premium User genTaliaru's Avatar
    Join Date
    Jan 2009
    Posts
    51

    Default ExtJs DataProxy overrider

    I tried to override Ext.DataProxy functions.

    I want that in before and after every ExtJs ajax request calls the script my function.
    I have coded script that looks like this
    Code:
    Ext.override(Ext.data.DataProxy, 
    {
    	listeners: 
    	{
    		beforeload: function() {
    			//doo my thing here
    		},
    		load : function()
    		{
    			//doo my thing here
    		}
    	}
    });
    But this doesnt work, can somebody tells me how can i get it to work.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    So, not every Ajax request then, but every request made through a Proxy? Let's get this clear first.

  3. #3
    Sencha Premium User genTaliaru's Avatar
    Join Date
    Jan 2009
    Posts
    51

    Default

    mkay, but how can i call my fuctions in every before and after ajax request

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    "Mkay" yourself.

    Answer the question. There are two options, and you are not clear.

    Every Ajax request.

    Or every request passed through a Proxy.

    When I know, then I can help.

  5. #5
    Sencha Premium User genTaliaru's Avatar
    Join Date
    Jan 2009
    Posts
    51

    Default

    every ajax request.

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Right.

    You need to use class level observability on the Ext.data.Connection class.

    http://www.extjs.com/deploy/dev/docs...e.observeClass

  7. #7
    Sencha Premium User genTaliaru's Avatar
    Join Date
    Jan 2009
    Posts
    51

    Default

    thanks a lot

  8. #8
    Sencha Premium User genTaliaru's Avatar
    Join Date
    Jan 2009
    Posts
    51

    Default

    Ok thanks, but if want to add a functions to proxy. how do i do that?

  9. #9
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    You mean add member functions to the class? Inject properties into its prototype.

  10. #10
    Sencha Premium User genTaliaru's Avatar
    Join Date
    Jan 2009
    Posts
    51

    Default

    Ok never mind, i alreay got my problem solved by using dataConnection

    thanks anyway

Posting Permissions

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