1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    24
    Vote Rating
    0
    pathum is on a distinguished road

      0  

    Question How to load a XML text to an uneditable field?

    How to load a XML text to an uneditable field?


    Hi,

    I am a newbie to Ext and I would like to know the procedure how to do the following.
    I have a data store in my webpage, designed by Ext and its being set by a store. For each and every row, there is a button for load a XML message to a new Window same as a pop-up.
    I need to implement this using Ext.Window. and I need to add a uneditable field to that window and get the map the XML into that field.
    pls help.

    p.s: I m using JSON objects to retrive the data from the DB.

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    "Uneditable field"?

    You mean you just want to display some XML?

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    You could do it like the "View Source" button does in http://dev.sencha.com/deploy/dev/exa...dropzones.html

    (Which is included in your SDK)

  4. #4
    Sencha User
    Join Date
    Sep 2010
    Posts
    24
    Vote Rating
    0
    pathum is on a distinguished road

      0  

    Default


    Here's my code. But the browser says there is a JS Error on page.
    Code:
    var message_store = new Ext.data.GroupingStore({
            baseParams:{ajax_command:'viewMsg'},
            proxy: new Ext.data.HttpProxy({
                url:'/connectivity/viewMsgDetails.ajax'
            }),
            reader: new Ext.data.JsonReader({
        
                root:'archive'
            }, Ext.data.Record.create([
                {name: 'textArchive'}    
            ])),    
            groupField:'',
            fields: ['textArchive']
        });
    
        var message_dataField = new Ext.form.displayField({
            value: (message_store.getAt(0)).data.textArchive
        });
    
        var messageForm = new Ext.FormPanel({
            labelWidth: 200,
            frame: true,
            displayField: 'textArchive',        
            draggable: false,
            height: 300,
            width: 800,
            items: message_dataField,
            triggerAction: 'all'
        });
    
        var viewMessage_window = new Ext.Window({
            title: '<%=i18NHelper.getString("view.message","connectivity")%>',
            width: 800,
            height:300,
            floating:true,
            shadow:true,
            modal:true,
            layout: 'fit',
            plain:false,
            bodyStyle:'padding:5px;',
            buttonAlign:'center',
            closeAction: 'hide',
            draggable :false,
            items: messageForm,
            buttons: [{
                text: '<%=i18NHelper.getString("label.close","connectivity")%>',
                handler  : function(){
                    viewMessage_window.hide();
                }
            }],
            listeners: {
                scope:this,
                beforehide: function(viewMessage_window) {
                    noSplash();
                }
            }
        });
    
        function showMessageWindow(textArchiveDid) {
    
            message_store.proxy.conn.url = '/connectivity/searchMsgDetails.ajax?textArchivedid='+ textArchiveDid;
            message_store.load({params:{start:0, limit:20}});
            viewMessage_window.show();
            viewMessage_window.setSize(800,300);
            viewMessage_window.center();
    
        };

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    97
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Didn't you ask this question already? You should be loading the form itself and not some store.

Similar Threads

  1. Load XML data from field into Ext.data.store?
    By jfizer in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 22 May 2009, 3:45 PM
  2. Need API to load xml content instead of xml file in ETX.Panel
    By sankarkumar in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 9 May 2009, 10:32 AM
  3. Not working mapping between text field and xml tag
    By Chamster in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 11 Jun 2008, 2:41 PM
  4. setting field label and field type based on XML value
    By brikonwall in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 18 Mar 2008, 7:16 PM
  5. Replies: 5
    Last Post: 5 Nov 2007, 12:12 PM

Thread Participants: 2