1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    5
    Vote Rating
    0
    kabab is on a distinguished road

      0  

    Default Unanswered: Help needed using display field inside form panel

    Unanswered: 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Have you inspected the DOM?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.