1. #111
    Ext User jermworm's Avatar
    Join Date
    Sep 2007
    Location
    Krugersdorp, South Africa
    Posts
    7
    Vote Rating
    0
    jermworm is on a distinguished road

      0  

    Default handler from loaded json

    handler from loaded json


    I'm missing something (or maybe I'm not) but the below example illustrates my problem
    I'm trying to load an edit form from a grid the rowDblClickHandler has
    Code:
    newwin=new regEditWindow; 
    newwin.show(this,grid.store.getAt(rowIndex)) ;
    The form shows ok except:
    a) I cannot get it to see the data (unless I make the data var global which I don't want to do)
    b) I cannot attach the handler unless I make the handler function global - I don't want to do that either.

    I want to be able to have two regEditWindows open at the same time with their own data handling their own events. (Maybe I'm going about this all wrong) I also don't want to clutter my code with form definition code.

    I'm almost certain the problem has to do with the 'scope' of the loaded form but how do I get it to be in the correct scope?

    If I'm going about this the completely wrong way a good example of how to do it the right way would be greatly appreciated.

    PHP Code:
    regEditWindow=function() {
        var 
    parent;
        var 
    window;
        var 
    data;
        
        return {
            
    show: function (parent,record) {
                
    this.parent=parent;
                
    this.data=record.data;
                
    this.window=new Ext.Window({
                    
    title'Edit Registration :' this.data.id,
                    
    width612,
                    
    height472,
                    
    // The next items: line works as I want
                    // items: new Ext.Panel({items: new Ext.Button({scope: this, handler:this.showdata,text:"Show Data"})})
                    
                    // The next items: line doesn't work I've tried all sorts of scope settings 
                    //   and different methods of specifying the handler
                    
    items: new Ext.ux.JsonPanel({scopethisautoLoad'form.json'})
                    
    /* form.json looks like :
                        {
                        xtype:"form",
                        id:"regform",
                        height:440,
                        width:600,
                        layout:"form",
                        frame:true,
                        items:[{
                            xtype:"button",
                            text:"Click Me!",
                            scope: this,
                            handler: function() {
                                this.showdata();
                            }
                          }]
                        }
                     */
                
    });
                
    this.window.show();
            },
            
    showdata: function() {
                
    alert(this.data.Company);
            },
        };


  2. #112
    Ext User
    Join Date
    Aug 2007
    Posts
    119
    Vote Rating
    0
    sierk is on a distinguished road

      0  

    Default


    Quote Originally Posted by jermworm View Post
    I'm missing something (or maybe I'm not) but the below example illustrates my problem
    I'm trying to load an edit form from a grid the rowDblClickHandler has ....
    I looked at you json and saw a scope:this binding. You cannot have this binding in JSON because this will be set to the scope of the eval and not the object. If you need behavaior like that uses this do that from within a event like render.

    Sierk

  3. #113
    Ext User jermworm's Avatar
    Join Date
    Sep 2007
    Location
    Krugersdorp, South Africa
    Posts
    7
    Vote Rating
    0
    jermworm is on a distinguished road

      0  

    Default


    Quote Originally Posted by sierk View Post
    I looked at you json and saw a scope:this binding. You cannot have this binding in JSON because this will be set to the scope of the eval and not the object. If you need behavaior like that uses this do that from within a event like render.

    Sierk
    Fair enough but it still doesn't work if I take it out (It was only in desperation I put it in) - the question remains how does one 'do that from within a event like render' i.e. How am supposed to do the binding without using global vars.

  4. #114
    Ext User
    Join Date
    Aug 2007
    Posts
    119
    Vote Rating
    0
    sierk is on a distinguished road

      0  

    Default


    Quote Originally Posted by jermworm View Post
    Fair enough but it still doesn't work if I take it out (It was only in desperation I put it in) - the question remains how does one 'do that from within a event like render' i.e. How am supposed to do the binding without using global vars.
    If i understand correctly you are trying to combine a JSON with code for a javascript file. The problem with that is that there is no connection between the JSON data and the script file as you also allready found out. You did a good step by setting the scope of the jsonpanel to this, but you are using it in a event of a button where this becomes the button. The only trick i now is to walk down the parentlist until you find the jsonpanel, or get the jsonpanel using Ext.getCmp() and then use the scope variable.

    Because of this problemen i make all the code i needed in the json-panel and use the component-id to access the functionality

    Hopes this helps

    In short: give JSONPanel an ID and then do Ext.getCmp("ID").scope.YourFunction

    Sierk

  5. #115
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    psavolai is on a distinguished road

      0  

    Default Tablelayout to fill container area

    Tablelayout to fill container area


    Hi Guys,

    For some reason when I use TableLayout it never fills the container area completely.
    How would I achieve this using GuiDesigner.

    - I'm asking because I find it easier to do complex forms with tables that having to use multiple formlayouts in one panel. After a while it gets really messy.

    I know that I can do this:
    .x-table-layout {
    width: 100%;
    }

    in my CSS-file, but seems a bit too global for my taste.
    I'd like to set only one table at the time.

    petri.

  6. #116
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    psavolai is on a distinguished road

      0  

    Default Sync or not sync

    Sync or not sync


    Another one,
    is this synchronous ?

    var myStuff = new Ext.ux.JsonPanel({autoLoad:'json/JsonPage3.json'});

    i.e. can I trust that myStuff is fully loaded after this line or not?
    if not, is there a mechanism for synchronizing through callbacks or something ?

    Petri.

  7. #117
    Ext User
    Join Date
    Aug 2007
    Posts
    119
    Vote Rating
    0
    sierk is on a distinguished road

      0  

    Default


    Quote Originally Posted by psavolai View Post
    Another one,
    is this synchronous ?

    var myStuff = new Ext.ux.JsonPanel({autoLoad:'json/JsonPage3.json'});

    i.e. can I trust that myStuff is fully loaded after this line or not?
    if not, is there a mechanism for synchronizing through callbacks or something ?

    Petri.
    The JsonPanel it self is asynchrone but the loading of javascript files (required_js) within the JsonPanel is synchrone. In the version 1.8 are no events which you could catch, I will add them to version 1.9. (beforejsonload,afterjsonload,failedjsonload). The only thing you can do for now is use a callback function
    PHP Code:
    autoload : {url 'json/JsonPage3.json',callback: function(){youcode}} 
    Sierk

  8. #118
    Ext User
    Join Date
    Aug 2007
    Posts
    119
    Vote Rating
    0
    sierk is on a distinguished road

      0  

    Default


    Quote Originally Posted by psavolai View Post
    Hi Guys,

    For some reason when I use TableLayout it never fills the container area completely.
    How would I achieve this using GuiDesigner.

    - I'm asking because I find it easier to do complex forms with tables that having to use multiple formlayouts in one panel. After a while it gets really messy.

    I know that I can do this:
    .x-table-layout {
    width: 100%;
    }

    in my CSS-file, but seems a bit too global for my taste.
    I'd like to set only one table at the time.

    petri.
    I will give this a try but for now the only thing is to but this in a ccs file and add it as required_css to the json. There should be also a other way but i will search. Also based on your problems if found a number of bugs in the wirzard which i will fix in next version.

    Sierk

  9. #119
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    psavolai is on a distinguished road

      0  

    Default New version weirdness ?

    New version weirdness ?


    Thanks Sierk,

    I downloaded the version 1.8 of GuiDesigner and version 2.1 of ext .

    Funny thing, the selection behaviour had gotten somewhat weird and I couldn't select
    (click on a panel and it would get yellow) as freely as I could on version 1.7.
    Ultimately I had to switch back to patched 1.7. to continue work.
    Do you want a screencam of the oddities ?

    "Ext version 2.1 is soo much better , faster and leaner than 2.02".
    .. yeah right.
    My json-based apps started mystically killing Firefox after 20 minutes of usage when running on ext 2.1.
    So I switched back and will wait for next dot release.

    Have you noticed similar things ?


    -==== ADDITION =====-
    Oh now I get it.
    I just read the new licensing policy.

    So they think that now ext has so much momentum that it can go commercial.
    Since no closed source product will GPL their stuff, they will have to buy licenses.
    Of course the team has every right to do this, but still ... ambush.
    I thought they could make enough money by selling services and education around ext, but apparently not.

    In this case I will stick to 2.02.

    Will this affect Gui Designer licensing as well ?
    If I wanted to build apps that were customizable and include GuiDesiner, would It have to be version 1.7 ?

    -==== ADDITION =====-


    Petri.
    Last edited by psavolai; 23 Apr 2008 at 9:16 AM. Reason: I read the licensing.

  10. #120
    Ext User
    Join Date
    Aug 2007
    Posts
    119
    Vote Rating
    0
    sierk is on a distinguished road

      0  

    Default


    Quote Originally Posted by psavolai View Post
    Thanks Sierk,

    I downloaded the version 1.8 of GuiDesigner and version 2.1 of ext .

    Funny thing, the selection behaviour had gotten somewhat weird and I couldn't select
    (click on a panel and it would get yellow) as freely as I could on version 1.7.
    Ultimately I had to switch back to patched 1.7. to continue work.
    Do you want a screencam of the oddities ?

    "Ext version 2.1 is soo much better , faster and leaner than 2.02".
    .. yeah right.
    My json-based apps started mystically killing Firefox after 20 minutes of usage when running on ext 2.1.
    So I switched back and will wait for next dot release.

    Have you noticed similar things ?


    -==== ADDITION =====-
    Oh now I get it.
    I just read the new licensing policy.

    So they think that now ext has so much momentum that it can go commercial.
    Since no closed source product will GPL their stuff, they will have to buy licenses.
    Of course the team has every right to do this, but still ... ambush.
    I thought they could make enough money by selling services and education around ext, but apparently not.

    In this case I will stick to 2.02.

    Will this affect Gui Designer licensing as well ?
    If I wanted to build apps that were customizable and include GuiDesiner, would It have to be version 1.7 ?

    -==== ADDITION =====-


    Petri.
    We will also stick to version 2.02 of the ExtJs package. We will check if it also works on other packages, but will not bundle it with any other version. Our source will stay LGPL so as long as you project complaint with this you can use it.

    Yes it would be greate to have screencam of the problem. Also if you could try it with the version at www.projectspace.nl because this is my test site.

    Sierk

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