1. #1
    Ext User
    Join Date
    Jun 2007
    Posts
    26
    Vote Rating
    0
    methodz is on a distinguished road

      0  

    Default BasicForm not setting Items?

    BasicForm not setting Items?


    Is there something explicitly wrong with the following code, or is the BasicForm not supposed to be able to load records into existing markup?

    PHP Code:
        <script type="text/javascript" src="/js/Ext/adapter/ext/ext-base.js"></script>                
        <script type="text/javascript" src="/js/Ext/ext-all.js"></script>                
        <script>        
            Ext.onReady(function(){
                    testForm = new Ext.form.BasicForm('test');
                    testForm.render('test');
            });
        </script>    
        <form name="test" id="test">
            <input type="text" name="name" />
        </form> 
    When using the above code, and inspecting the object after the page renders, the items array is empty, which is why the loadRecord, setValues function(s) aren't working properly, is there some gross error in how I'm attempting to use BasicForm?

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    2
    tryanDLS is on a distinguished road

      0  

    Default


    Kinda of hard to say without seeing more code. What does the json response look like? Did you call load and does firebug show the request going out and coming back?

  3. #3
    Ext User
    Join Date
    Jun 2007
    Posts
    26
    Vote Rating
    0
    methodz is on a distinguished road

      0  

    Default not the problem

    not the problem


    I can rule out JSON Being the problem, because all the XHR looks completely normal, try this in firebug, with that code example you should be able to run this in the console & have the field populate testForm.setValues({id:'name',value:'test'}); but that doesn't work...

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    2
    tryanDLS is on a distinguished road

      0  

    Default


    I don't see how that could work - you have a field called name but you're calling setvalue with id and value.

    You shouldn't be doing that directly anyway - calling load will populate the fields with the data you send back, assuming that you match the names correctly.

  5. #5
    Ext User
    Join Date
    Jun 2007
    Posts
    26
    Vote Rating
    0
    methodz is on a distinguished road

      0  

    Default Load calls setValues

    Load calls setValues


    I've dug all the way back into this code, and the load method invokes the same thing that setValues or loadRecord does, one problem is I'm trying to work with this with a single row result from a grid's datastore, but again, the use of the load method doesn't appear to be the problem, when the form is constructed, it doesn't set the internal items array properly, I've tried dropping the id value from every field and I still don't get that array...

  6. #6
    Ext User
    Join Date
    Jun 2007
    Posts
    26
    Vote Rating
    0
    methodz is on a distinguished road

      0  

    Default No properties

    No properties


    It appears unless I define each of the values in js and attach them to the elements in my basicForm, (Double the work) the basicform doesn't serve the purpose of an effective container.

  7. #7
    Sencha User
    Join Date
    Aug 2007
    Posts
    25
    Vote Rating
    0
    gpasq is on a distinguished road

      0  

    Default


    Did you ever get this to work without also creating the fields in JS? I cannot either.

    Quote Originally Posted by methodz View Post
    It appears unless I define each of the values in js and attach them to the elements in my basicForm, (Double the work) the basicform doesn't serve the purpose of an effective container.

Thread Participants: 2

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