Results 1 to 2 of 2

Thread: Help needed using display field inside form panel

  1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default Help needed using display field inside form panel

    Hello everybody,
    I have added a display field in form panel , and value in display field is fetched from server , the issue is that if a large quantity of data is sent from back end the data is displayed messy/not properly formatted in display field i tried logging the data just before attaching it to value filed of display filed and the data is properly formatted/readable and no issues .

    Eg: If data has 3 lines like :
    'Hi my name is kabab
    I live in India
    I love food '
    Then if we look it in display field it will be:

    Hi my name is kababI live in India
    I love food
    I want the data to be displayed in same format as it was earlier.
    Code:
    function showCurrentConfiguration() {
            Ext.create('Ext.form.Panel', {
            id:'ShowConfigPanel',
                 width: 175,
            height: 120,
            bodyPadding: 10,
            title: 'Current Configuration',
            items: [{
                xtype: 'displayfield',
                  id:'displayField',
                fieldLabel: 'Current Configuration',
                name: 'current_configuration',
                value: ''
            }]
        });
        var formPanel=   Ext.getCmp('ShowConfigPanel');
        var options = new Array();
         options['eventId'] = 'nativemethodcall';
         options['url'] = ' /mainui/ctrl/client-webWeb/CMPServlet?action=net.kabab.landingPage.action.GetConfiguration';
         options['method'] = 'getDeviceConfigDetails';
         options['data'] = 'abc';
       
        options['failure'] = function() {
                               //  showError("Could not Process Request");
     
                             };
     
                             options['success'] = function(data) {
                                 console.log("......Config result " + data);
                                 Ext.getCmp('displayField').setValue(data);
     
                             };
                             Jx.JxAction.doAction(this, "nativemethodcall", options);
     
     
        formPanel.show();
        JsUtils.addToUICanvas(formPanel);
    }
    Please help.Thanks in advance

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Have you inspected the DOM?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

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

Posting Permissions

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